Differences in label: syntax?
#7332
-
|
For this diagram ```mermaid
flowchart LR
List@{ shape: braces, label: "📋 List
☐ Step A
☑ Step B
☑ Step C
☐ Step D
☐ Step E
☐ Step F
☐ Step G" }
```I want to add exactly one empty line between All my attempts, however, give different results:
... except 3 and 4 (which both render 3 I have looked at the help:
According to Commonmark rules, a newline with an empty line is enough to generate a paragraph. I am very new to Mermaid - so it might be mentioned somewhere else. Thank you for your time and effort |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The
So in your attempts:
To get exactly one visible blank line between the title and the steps, you want exactly 2 That gives you: the If that still produces too many or too few breaks, try without the empty line: This explicitly controls the spacing without relying on newline handling, which can vary slightly between renderers. You are right that this is under-documented. The label content is ultimately rendered as SVG |
Beta Was this translation helpful? Give feedback.
The
label:parameter in the@{}syntax uses HTML-like rendering, not CommonMark. Here is how line breaks work in practice:<br/>in the rendered SVG<br>tags add an additional break on top of the newline character<br/>sSo in your attempts:
<br>after title + empty line = 3 breaks (the explicit<br>+ 2 from double newline)<br><br>+ empty line = 4 breaks<br>on its own line = same as #3To get exactly one visible blank line between the title and the steps, you want exa…