-
Notifications
You must be signed in to change notification settings - Fork 264
Open
Description
https://www.w3.org/TR/2014/CR-DOM-Parsing-20140617/#serializing
- If the require well-formed flag is set (its value is true), and node's data contains characters that are not matched by the XML Char production [XML10], then throw an exception; the serialization of this node's data would not be well-formed.
- Let markup be the value of node's data.
- Replace any occurrences of "&" in markup by "&".
- Replace any occurrences of "<" in markup by "<".
- Replace any occurrences of ">" in markup by ">".
- Return the value of markup.
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:
var doc = new DOMParser().parseFromString('<test/>', 'text/xml');
doc.documentElement.appendChild(doc.createTextNode('hello ]]> there'));
new XMLSerializer().serializeToString(doc) // "<test>hello ]]> there</test>"Such behavior was added in 47fa9b8
saschanaz and smoke
Metadata
Metadata
Assignees
Labels
No labels