Open Leprosy opened 3 years ago
Thank you for reporting @Leprosy! :slightly_smiling_face:
I believe the issue is caused by Happy DOM not having support for "application/xml". It will fallback on treating the code as HTML.
I will look into adding support for "application/xml".
Glad to be of help! As I said before, excellent library!
Ran into this when using new DOMParser().parseFromString(file, "image/svg+xml")
Would be a better user experience if parseFromString threw an error for not implemented mime types.
Sadly the workaround to parse svg is to use jsdom.
import jsdom from "jsdom";
const {
window: { DOMParser },
} = new jsdom.JSDOM();
Any update regarding this 3 years issue ?
thanks
Hi, I'm trying to parse this XML document:
But this is obtained as a result:
The main issue is that the
<start>
and<span>
tags are getting closed in the wrong position. I'm comparing the parsed document with another using google chromeDOMParser
implementation and the result got parsed correctly. Is there some option/configuration/parameter I'm missing here?