d2
d2 copied to clipboard
Bad SVG generation with markdown newlines
Summary
OS: Ubuntu 22.04
Browser: Firefox 107.0
D2 cli version: v0.0.13
Error:
When compiling a node with markdown inside, it will create an invalid SVG file. See below.
XML Parsing Error: mismatched tag. Expected: </br>.

Expected result
- Either a compiler error if new lines are not supported
- Or the following image:

Note
It requires 2 things to produce a working SVG:
- Replace
<br>with<br /> - The
heighton theforeignObjectshould be adjusted (from 24 to 48 in my case)
Code to reproduce
d2 file.d2 file.svg
mainframe: Mainframe Banking System {
explanation: |md
Stores all of the core banking information
about customers, accounts, transactions, etc.
|
style: {
stroke: "#aaaaaa"
}
}
thank you for the 💯 bug report