Text nodes do not get escaped when getting innerHTML
jpnelson opened this issue · 0 comments
jpnelson commented
The innerHTML getter cannot just return textContent.
See https://w3c.github.io/DOM-Parsing/#serializing , scroll to Text
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.
We will need to do this manually when getting the innerHTML of something containing a text node.