mermaid-js / mermaid-cli

Command line tool for the Mermaid library
MIT License
2.35k stars 226 forks source link

SVG is not displayed corectly in Gimp, Pinta, display or Image viewer #717

Closed Mo-way closed 1 month ago

Mo-way commented 1 month ago

Description

I have a file, say mwe.mmd:

graph TD;
Harry-- friend -->Ron;
Ron-- Girlfriend -->Hermione;

Then I use mmdc -i mwe.mmd -o mwe.svg to generate svg output. However, I'm unable to properly view the content, as all texts are missing in Gimp, Pintam and Gnome image Viewer. Inkscape doesn't work at all. The texts are in the svg, I assume, because they display correctly in chrome. Pltform is Ubuntu 22.04.

What I see

offline-viewing-mwe 2024-07-23

Output in browser

mwe

Tried solutions

mofosyne commented 1 month ago

Maybe mmdc could have a pipe output when --output - --outputFormat png and pipe it to something like display from ImageMagick-im6.q16. Should not be too hard to implement.

cat example.mermaid | mmdc --input - --output - --outputFormat png | display
Mo-way commented 1 month ago

Maybe mmdc could have a pipe output when --output - --outputFormat png and pipe it to something like display from ImageMagick-im6.q16. Should not be too hard to implement.

Not sure what that would help, display has the same issues as all the tools above. The issue is specifically about SVG output not being displayed properly.

I edited the title to better reflect that

Mo-way commented 1 month ago

Duplicate of #691