The jsvalue function returns a regular string, which goes through the regular escaping, including quote escapes. This unfortunately breaks HTML in legacy mode as they do not parse HTML escapes in JavaScript code. We should probably return an escaped string by default, perhaps changing that for XHTML/XML mode. Complicated.