Sandboxed rendered, but normal svg output #4375
Unanswered
DavidMulder0
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is there a way to use the sandboxed renderer, but retrieve a clean svg (rather than a iframe with a data URI)?
Use case: My final rendering environment has not great SVG support (Apache FOP), so I was planning on drawing the mermaid svg output to a canvas and then include it as a PNG. My CSS rendering environment however is 'tainted', so the bounding box calculations are affected (at least, that's my hypothesis based on what I am seeing), which is solved by the sandboxed renderer which runs everything in an iframe, but then in the last step it claims to return an svg, but it's actually an
<iframe>node 🥺 . Obviously I can both manually unwrap the iframe code (which is icky, because the code might change thus breaking the unwrap in the future) or I can manually run mermaid inside a sandboxed iframe (which isn't that bad, but would make my code needlessly complex),All reactions