Open arthurbrenno opened 3 months ago
I think this is a duplicate of: https://github.com/mermaid-js/mermaid-cli/issues/691
TLDR:
It looks like this is an issue with mermaid-cli after all: [Mermaid's] 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.
Sorry, I still don't understand, @Mo-way. Is this a solution?
Please tell mermaid-cli to use SVG text elements instead.
In this case, how can I instruct mermaid-cli
to do this?
Hi @pbittencourt, you might have some luck by following https://github.com/mermaid-js/mermaid/issues/2688#issuecomment-1242762992
Some diagrams have a htmlLabels: false
config setting that you can pass that might stop them from using <foreignObject>
/embedded HTML.
However, even if you do do this, some Mermaid diagrams still use CSS which is valid in the SVG 2.0, but isn't valid in SVG 1.1 that many libraries like librsvg
(see https://github.com/mermaid-js/mermaid/issues/2102)
As a work-around, you could try asking mermaid-cli
to make a PDF file, then using a tool like pdf2svg
to create an SVG file from that PDF: https://github.com/mermaid-js/mermaid/issues/2102#issuecomment-2183791698
Describe the bug I'm trying to generate a mermaid diagram from an ouput. The output generates valid mermaid diagram in mermaid.live, but the generated output using the cli just gives me a diagram with no text.
To Reproduce Execute this function:
Expected behavior To generate a mermaid diagram with the original text in it.
Screenshots any diagram will look like this:
I'm using mmdc 10.3.1, NixOS (Google IDX) with pkgs.mermaid-cli.
Additional context Add any other context about the problem here.