jsbrowser: Fix handling of html with non lxml safe chars