-
-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
html parser doesn't handle cdata #59
Comments
Even more seriously: <script><![CDATA[
</script>
]]></script> results in [ { type: 'script',
name: 'script',
attribs: {},
children: [ { data: '<![CDATA[\n', type: 'text' } ],
prev: null,
next: null,
parent: null },
{ data: '\n]]>', type: 'text' } ] when it should result in [ { type: 'script',
name: 'script',
attribs: {},
children: [ { data: '\n</script>\n', type: 'cdata' } ],
prev: null,
next: null,
parent: null } ] |
This behavior was changed in order of fixing jsdom/jsdom#618 and #32. At least the behavior for special tags could arguably be changed, your example points out nicely what issues may arise. The HTML behavior is in line with the spec; if you want CDATA, enable the XML mode. |
Here is a pretty common example which breaks
|
CDATA sections are normalized with |
This issue was actually solved in #74. @stevenvachon If you don't want your whitespace to be normalized, don't set that option. |
<![CDATA[ This should be CDATA... ]]>
results in
when it should result in
using version 3.1.5
The text was updated successfully, but these errors were encountered: