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
Parsing SVGs using: parser.parseFromString(svg, "image/svg+xml");
adds HTML and BODY tags around the SVG.
Wheras doing this using JSDOM or in the browser console does not add the additional tags. This means happy-dom is not a drop-replacement for jsdom and does not emulate browser behaviour.
Describe the bug
Parsing SVGs using:
parser.parseFromString(svg, "image/svg+xml");
adds HTML and BODY tags around the SVG.
Wheras doing this using JSDOM or in the browser console does not add the additional tags. This means happy-dom is not a drop-replacement for jsdom and does not emulate browser behaviour.
To Reproduce
See git repo here with jsdom and happydom examples:
https://github.com/drtimwright/happy-dom-tests/tree/main/src
I'd expect this command to return "svg" not "html":
new DOMParser().parseFromString("<svg><g></g></svg>", "image/svg+xml").getRootNode().childNodes[0].nodeName;
Expected behavior
Device:
Additional context
I'll try to make a PR for this, but no promises!
The text was updated successfully, but these errors were encountered: