Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "]]>" serialization in text nodes
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.
- Loading branch information