This escaping:
|
if ( |
|
parentTn === $.STYLE || |
|
parentTn === $.SCRIPT || |
|
parentTn === $.XMP || |
|
parentTn === $.IFRAME || |
|
parentTn === $.NOEMBED || |
|
parentTn === $.NOFRAMES || |
|
parentTn === $.PLAINTEXT || |
|
parentTn === $.NOSCRIPT |
|
) { |
|
this.html += content; |
|
} else { |
|
this.html += Serializer.escapeString(content, false); |
|
} |
is meant to mimic
HTML's
If the parent of current node is a style, script, xmp, iframe, noembed, noframes, or plaintext element, or if the parent of current node is a noscript element and scripting is enabled for the node, then append the value of current node's data IDL attribute literally.
However, while HTML is referring specifically to those nodes in the HTML namespace, parse5 does not check the namespace before serializing.
This leads to the following wrong result in jsdom: https://runkit.com/domenicdenicola/6044168f463fb4001a725307 compared to browsers: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=8981
This escaping:
parse5/packages/parse5/lib/serializer/index.js
Lines 136 to 149 in 9c683e1
However, while HTML is referring specifically to those nodes in the HTML namespace, parse5 does not check the namespace before serializing.
This leads to the following wrong result in jsdom: https://runkit.com/domenicdenicola/6044168f463fb4001a725307 compared to browsers: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=8981