-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Just black squares in Inkscape / other software then Browsers #447
Comments
It sounds like this is caused by the main mermaid project: mermaid-js/mermaid#2102 Basically, Mermaid uses CSS variables, which are quite a new feature and are not supported in most SVG software except for browsers. There are some work-arounds in that issue, e.g. using PDF -> SVG, using a custom CSS style-sheet, or going back to Mermaid v8.14. Ideally, the main mermaid project would remove CSS variables from their style sheet to be compatible with more programs, but I've got no idea how much work that would be to implement. |
It's not just CSS variables. Mermaid uses HTML elements, which are not SVG elements. From linebender/resvg#564 (comment)
The following issues appear to be duplicates, so this issue can probably be closed:
|
👍 I think the HTML elements issue only affects flowcharts, and can be fixed by passing
Good catch. My gut feeling is to keep at least an issue in this repo open as well, since the main |
AFAICT, the issue affects most, if not all MermaidJS diagrams. In my editor, KeenWrite, I can enter the following diagrams:
The output: Graphviz diagrams, OTOH, work flawlessly: It's pretty easy to see that all the SVG files being generated tuck HTML elements inside for text instead of using the |
Ran into the same issue today.. also looking at mermaid-js/mermaid#2485, and will try the workarounds presented in mermaid-js/mermaid#2102 EDIT: the |
@tensionhead -- The EchoSVG library is able to render a number of MermaidJS diagrams. Not perfect, but usually the text comes through okay. Depending on your use case, my text editor, KeenWrite, which integrates EchoSVG, may be helpful. See the tutorials for details. |
Thanks @DaveJarvis , I got the mermaid client running now (see #572 ).. will check if the pdf output does what I need (import into inkscape). EDIT: running the |
This actually seems like a pretty great workaround. Using mermaid-js/mermaid-cli with a PDF output, then using something like The main issue is that all text is converted into paths, so people with screenreaders can't read the text, and users can't copy-and-paste text from the SVG. Some of the FontAwesome icons also have some weird colors. If you care about accessibility, you can use |
I am making an |
Describe the bug
SVG in Inkscape is just shown as black squares.
To Reproduce
Put example class diagram in
.mmd
file and runmmdc -i myfile.mmd -o ./out.svg
Expected behavior
Display diagram with styles instead of black squares
Screenshots

The text was updated successfully, but these errors were encountered: