Skip to content
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

resolves #924 return valid SVG/XML #926

Merged
merged 1 commit into from
Oct 2, 2021

Conversation

ggrossetie
Copy link
Member

We were using innerHTML which converts <br/> to <br>. It's interesting to note that <br> is valid HTML but invalid XML.

To serialize an SVG to string, we must use new XMLSerializer().serializeToString(node).
Reference: https://developer.mozilla.org/en-US/docs/Web/API/XMLSerializer/serializeToString

resolves #924

//cc @cowboy

@ggrossetie ggrossetie merged commit 80d04bb into yuzutech:main Oct 2, 2021
@ggrossetie ggrossetie deleted the issue-924-mermaid-valid-xml branch October 2, 2021 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<br> in Mermaid breaks generated SVG
1 participant