Backport of html5Mode fixes to v1.2.x

This is just for a CI run, that's all. If it's green, it will go into the tree.