Thanks for sharing this technique.
On 06/11/2016 05:48 AM, Leif Halvard Silli wrote:
Resending with markdown disabled (due to encoding issue with the markdown interpreter of my email program): As is known, the processing instructions (PI) of XMLEditor’s revision functionality have some side effects when HTML documents are rendered as text/html in a Web browser: 1. The title elements renders with a PI as part of its textual content 2. Script and style elements stop to function The title element issue can be hacked around with a script that removes the PI element from the text/html rendering: document.title = document.getElementsByTagName("title" )[0].textContent.replace(/^<\?xxe[^>]+>/,""); Whereas the script and style elements can be made to work by introducing code that causes the script/style element to be interpreted as two elements (rather than one element) when rendered as text/html (due to text/html’s lack of aderhence to CDATA declarations). Script element example: <script>/*<![CDATA[</script><script>/**/ document.title = document.getElementsByTagName("title")[0].textContent.replace(/^<\?xxe[^>]+>/,""); /*]]>*/</script> When XMEditor with Revision trackign enabled saves the above code, it will (currently) end up looking something like this - which still works: <script><?xxe-sn rmbeo5stba 1xlgve8i36frr?>/*<![CDATA[*//*</script><script>/**/ document.title = document.getElementsByTagName("title")[0].textContent.replace(/^<\?xxe[^>]+>/,""); /*]]>*/</script> Style element example: <style>/*<![CDATA[</style><style>/**/ body {background:lime} /*]]>*/</style> Hope this helps someone ...
-- XMLmind XML Editor Support List xmleditor-support@xmlmind.com http://www.xmlmind.com/mailman/listinfo/xmleditor-support