This fixes issue #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.
This fixes issue #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:
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.