question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mermaid missing text in svg

See original GitHub issue

Describe the bug i created a simple mmdc file. and when generated to an svg it is missing text.

To Reproduce i made a file called test.mmdc wit this code:

graph TD id1[This is the text in the box]

then I converted it with this command: mmdc -i test.mmdc

it then generated this: https://imgur.com/a/FmDRxV3

Expected behavior I expected that the text “This is the text in the box” would appear in the box

Screenshots https://imgur.com/a/FmDRxV3

Desktop (please complete the following information):

  • OS: windows 10
  • Browser chrome
  • Version89.0.4389.90

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
merrickluocommented, Jun 28, 2021

@MindaugasLaganeckas the config file I use is like this

{
  "flowchart": {
    "useMaxWidth": false,
    "htmlLabels": false
  }
}

only the htmlLabels part matters though. I just use it by passing the file to mermaid-cli mmdc -c ~/.config/mermaid/config.json

4reactions
merrickluocommented, Apr 18, 2021

Did a little digging, it seems that when using graph, mermaid generated svg is using foreignObject to render the text in node, and emacs and some other svg viewer is not handling it well (browser renders it fine).

Update: This can be workaround by adding a custom config file set htmlLabels to false.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Baby Mermaid on Board Svg .eps Png Files for Cutting ... - Etsy
Baby Mermaid On Board svg .eps png Files for Cutting Machines Cameo Cricut, Newborn, Baby Boy, Baby Girl, Little Miss Mermaid, Mama Mermaid....
Read more >
Mermaid - Package Control
:tropical_fish: The missing Sublime Text 3 package for Mermaid ... PNG conversion from SVG conflicts with opening file-URL's, so it's a link.
Read more >
SVG not rendering text within a shape - Stack Overflow
I am using an SVGDocument to convert a graph created using Mermaid to bitmap format so it can be copied to the clipboard,...
Read more >
Maybe Don't Use Flow Charts on GitHub - Adrian Roselli
Include diagrams in your Markdown files with Mermaid ... No. Yes, and it is lengthy. Yes, a brief one. SVG. `none`. `table` ......
Read more >
Pin on piñatas de sirena - Pinterest
Mermaid Font M SVG - Free SVG files | HelloSVG.com ... mamá SVG sirena mamá Svg sirena cola svg | Etsy Mermaid Svg,....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found