-
Notifications
You must be signed in to change notification settings - Fork 84
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
Mermaid support is broken (by mermaid and svgcheck) #233
Comments
Hi Björn, thank you very much!
Is that used for anything except error messages? You may want to create an issue (or a PR) at:
Yes. I always wondered wether it is worth to implement a more powerful SVG processor inside kramdown-rfc given that
Wow. I'll need to find an easy way to install cutycapt (I don't find it in homebrew). |
So how do you actually build cutycapt? Would it make sense to port the source from sourceforge to github? |
I put the code here https://github.com/hoehrmann/CutyCapt but as you can see I haven't touched the code in 11 years... Back in the day But it used to be included in most Linux distributions, I used the Debian package. |
(Leaving this here, it might help other users:)
The current version of
svgcheck
has a rather odd bug where it attempts to read from a "stdin" file in the current directory when called without arguments. I made a little change torun.py
to get it to work at all:Using the current version of mermaid, my simple flow chart is translated by
mmdc
into an ... interesting SVG file that makes use of CSS variables and possibly other advanced and anachronistic features.This comment mermaid-js/mermaid#2102 (comment) suggested running the
mmdc
output throughrsvg-convert -f svg -o in.svg out.svg
. That worked nicely, except that all node labels are lost because they are encoded like this:And SVG implementations usually do not implement a HTML+CSS rendering engine on the side.
I pioneered HTML+CSS to vector graphic conversion adding EMF output support to https://iecapt.sf.net/ over 20 years ago, and a couple of years later added SVG output support to its companion https://cutycapt.sf.net/ and lo and behold,
cutycapt --url=file:///home/bjoern/.../in.svg --out=out.svg
also handles the theforeignObject
s (turning the text into paths). Thensvgcheck
does not like the colours and I get black text on black background.Adding this to the mermaid code helps:
With this setting, the pipeline
mmdc | cutycapt | svgcheck -r
produces a legible result.The text was updated successfully, but these errors were encountered: