Ok, so using draw.io desktop, I start a new Blank diagram, and draw just a single textbox with two lines of text inside:
Then I do File/Export as/SVG..., choose Zoom 100%, uncheck "Include a copy of my diagram", hit Export, save as test.svg
- and the result is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="81px" height="81px" viewBox="-0.5 -0.5 81 81" style="background-color: rgb(255, 255, 255);"><defs/><g><rect x="0" y="0" width="80" height="80" fill="#ffffff" stroke="#000000" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 40px; margin-left: 1px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Lucida Console; color: #000000; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; ">Hello<br />World!</div></div></div></foreignObject><text x="40" y="44" fill="#000000" font-family="Lucida Console" font-size="12px" text-anchor="middle">Hello...</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://desk.draw.io/support/solutions/articles/16000042487" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Viewer does not support full SVG 1.1</text></a></switch></svg>
This file opens fine in Firefox:
However, if I open it in Inkscape 1.0.1 - the text is not fully there:
... and if I convert this SVG to PDF using rsvg-convert
(from mingw-w64-x86_64-librsvg 2.50.1-1, in MSYS2/MINGW64 shell in Windows 10)
rsvg-convert.exe -f pdf -o test.pdf test.svg
... and then I open that PDF in Firefox, I get the text broken again (and same goes if I open this PDF in Adobe Reader, etc):
As we can see from the SVG content above, the full message here should be "Viewer does not support full SVG 1.1", and that links to https://desk.draw.io/support/solutions/articles/16000042487 , which explains that this is due to word wrapping - and I either have to turn off word wrap in Draw.io (which I do not want - I exactly want to draw boxes with word-wrapped text inside), or export to PDF.
However, I need an .svg, that will go in a pandoc Markdown -> PDF pipeline, and since that also uses rsvg-convert, the .svg images end up being embedded with errors in the document.
So, I was thinking - can I somehow export this kind of SVG1.1 file (with word-wrapped text) to SVG1.0 (with one text line for each line of wrapped text)? If Inkscape could have read this file, I could have used its --export-plain-svg
- but as shown above, also Inkscape fails at loading this .svg file...