You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Restore proper rendering of plain text flowchart labels without auto line-wrapping
6
+
7
+
This fix restores backwards compatibility with Mermaid v10 by ensuring that plain text labels in flowcharts are rendered correctly. In Mermaid v11, all labels were incorrectly being treated as markdown by default, which caused issues with text wrapping, multiline breaks, and backwards compatibility.
8
+
9
+
**What changed:**
10
+
11
+
- Plain text labels in flowcharts (without markdown syntax) now render as regular text
12
+
- For node labels and edge labels, these will line-wrap automatically. Although this isn't backwards compatible with v10, we think this is a minor change and it's worth keeping to avoid too many changes from diagrams created from v11 onwards.
13
+
- Plain text labels in other diagrams will continue to not line wrap.
14
+
- Plain text labels with `\n` characters now correctly create line breaks
15
+
- Plain text that looks like markdown (e.g., "1.", "- x") is no longer misinterpreted
16
+
17
+
**If you want markdown formatting:**
18
+
You can still use markdown in your flowchart labels by using the proper markdown syntax. Wrap your markdown text with double quotes and backticks:
19
+
``node["`_markdown_ **text**`"]``
20
+
21
+
Example:
22
+
23
+
````markdown
24
+
```mermaid
25
+
flowchart TD
26
+
plain["Plain text\nwith manual line break"]
27
+
markdown["`This is a **markdown** _label_ that wraps and doesn't replace \n with newlines`"]
0 commit comments