mermaid-js / mermaid-cli

Command line tool for the Mermaid library
MIT License
2.39k stars 227 forks source link

mmdc not generating labels for SVG outputs #691

Open radupotop opened 4 months ago

radupotop commented 4 months ago

Describe the bug

mmdc does not generate labels when outputting SVG files. This happens for flow charts and class charts on my machine, but not for sequence diagrams for example.

To Reproduce Steps to reproduce the behavior:

echo "graph TD; THIS-->THAT; THAT-->THIS" | mmdc -i -

Output:

image

Expected behavior

The graph should include labels like so:

out

Desktop (please complete the following information):

My gut feeling is this is related to rendering on my machine (pango, cairo, etc).

radupotop commented 4 months ago

Opened a corresponding issue here with librsvg:
https://gitlab.gnome.org/GNOME/librsvg/-/issues/1082

radupotop commented 4 months ago

It looks like this is an issue with mermaid-cli after all:

This SVG uses foreignObject to embed HTML text. Supporting this would basically involve having a whole HTML renderer inside librsvg. Please tell mermaid-cli to use SVG text elements instead.

threepistons commented 1 week ago

I have this problem too.

My input Markdown file and output PNG and SVG files are attached, as are how Inkscape and Gwenview render the SVG file. wardrobe-sort.md wardrobe-sort wardrobe-sort gwenview inkscape