Closed zeitderforschung closed 1 year ago
Thanks for reporting this. I would like to fix this ASAP, but I'm very busy this week. You can try to fix it yourself of you want.
The issue comes from https://github.com/remcohaszing/mermaid-isomorphic/blob/main/browser.ts#L42
I guess it's related to the DOM Parser that fails on parsing the svg due to missing enclosing tags. A workaround would be replacing the parser by something like this as you proposed here:
const wrapper = document.createElement('div')
wrapper.innerHTML = svg
const element = wrapper.firstChild as SVGSVGElement
I fixed it upsteam. You can pull in the fix by updating mermaid-isomorphic
in your lockfile.
I get an error, when rendering the following mermaidjs diagram with rehype-mermaidjs 2.0.0 that is caused by mermaid-isomorphic 2.1.0. All the other diagrams I have tested work fine.