You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Script and style tags don't decode HTML entities, so myScript.textContent should contain < etc if present. This appears to work when creating a script element through document.createElement, but not when using new DOMParser().parseFromString.
Describe the bug
Script and style tags don't decode HTML entities, so
myScript.textContent
should contain<
etc if present. This appears to work when creating a script element throughdocument.createElement
, but not when usingnew DOMParser().parseFromString
.To Reproduce
(Running the above in a browser, skipping the happy-dom setup, gives the expected result)
Expected behavior
HTML entities are not decoded by
textContent
when used inside a script tag innew DOMParser().parseFromString
.Device:
Additional context
I ran into this when embedding data containing HTML entities into documents with
<script type="application/json">
.The text was updated successfully, but these errors were encountered: