-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Both angle braces must be escaped #164
Comments
This issue breaks prettify-xml which depends on angle braces for indentation. <constructor>
<param name="paths" type="sequence<Path2D>"/>
<param name="fillRule" optional="1" type="CanvasFillRule"/><!-- broken -->
</constructor> |
Holzhaus
added a commit
to Holzhaus/xmldom
that referenced
this issue
May 27, 2017
This fixes issue jindw#164, which is a regression caused by commit 47fa9b8. Before, text nodes were serialized correctly (thanks to commit 22fff92). Section 2.4 of the XML 1.0 (5th Ed) recommendation states: The right angle bracket (>) may be represented using the string ">", and MUST, for compatibility, be escaped using either ">" or a character reference when it appears in the string "]]>" in content, when that string is not marking the end of a CDATA section. See https://www.w3.org/TR/2008/REC-xml-20081126/#syntax for details. Thus, this commit escapes the right angle bracket in text nodes if it appears as part of "]]>". If not, the right angle bracket is not escaped. The unittest that was broken since commit 47fa9b8 has been fixed, too.
PR #207 should fix this without breaking prettify-xml. |
It seems there already is a relevant PR. #132 (Though it should also be added on attributes) |
Conversation can be continued in xmldom/xmldom#58 since this is currently the place where the project is being maintained. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.w3.org/TR/2014/CR-DOM-Parsing-20140617/#serializing
Please add
>
to the list of escaped characters here (and above as well).But this will break this test. Why are you expecting
>
to be left as is? This is not standard behavior.Try this in browser:
Such behavior was added in 47fa9b8
The text was updated successfully, but these errors were encountered: