Repository navigation
Fix non-markdown labels in flowcharts being treated like markdown #7276
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
Merged
Merged
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
8491523
fix: Add markdown-specific behavior on top of the common rendering chβ¦
darshanr0107 5a8ddd0
fix: streamline label creation in labelHelper function
darshanr0107 2cc90ef
fix: remove unused HTML label handling and streamline edge label creaβ¦
darshanr0107 ef2e43d
[autofix.ci] apply automated fixes
autofix-ci[bot] 50fa149
fix: simplify label creation in rect function by directly assigning tβ¦
darshanr0107 970e5d8
Merge branch 'markdown-specific-changes' of https://github.com/mermaiβ¦
darshanr0107 287b94d
fix: update useHtmlLabels logic in labelHelper function
darshanr0107 99be550
fix: refactor label handling for markdown in clusters and edges
darshanr0107 f7de942
Revert "fix: refactor label handling for markdown in clusters and edges"
darshanr0107 649ee28
fix: set labelType to markdown for class relations
darshanr0107 931f3df
fix: set labelType to markdown for relationship edges
darshanr0107 a2587bc
fix: set labelType to markdown for requirement edges
darshanr0107 4893a9d
fix: update label type to markdown for state diagram edge labels
darshanr0107 443ff41
fix: update erBox to use getEffectiveHtmlLabels for label rendering
darshanr0107 5ac588a
Revert "fix: update erBox to use getEffectiveHtmlLabels for label renβ¦
darshanr0107 ab2d919
fix: enhance labelHelper to support markdown labels and improve labelβ¦
darshanr0107 a3841e8
fix: set labelType to markdown for note labels
darshanr0107 31abe0c
fix: update labelHelper to use logical OR for width calculation and sβ¦
darshanr0107 63c2f6e
Merge branch 'develop' into markdown-specific-changes
darshanr0107 80de539
fix: update edge label handling by removing default width and improviβ¦
darshanr0107 cdfc346
Merge branch 'markdown-specific-changes' of https://github.com/mermaiβ¦
darshanr0107 1e06438
fix: append label element to edge label node for proper rendering
darshanr0107 2a045fa
fix: update insertEdgeLabel to pass the element to createText for marβ¦
darshanr0107 bc5382e
fix: update insertEdgeLabel to pass the element for label creation
darshanr0107 5f3b5a8
fix: enhance insertEdgeLabel to support markdown and adjust width hanβ¦
darshanr0107 25e1449
fix: wrap non-markdown text in paragraph tags for proper HTML formatting
darshanr0107 fa2f6c0
chore: update changeset
darshanr0107 904a589
fix: add nonMarkdownToHTML function for proper HTML conversion of nonβ¦
darshanr0107 43ca299
fix: specify labelType as markdown in insertEdges for block diagram
darshanr0107 9da5864
chore: add changeset for autoWrap in flowcharts
darshanr0107 7949762
fix: add isNode property to edge label configuration for block diagraβ¦
darshanr0107 4e7d35f
fix: update label background color handling in block diagram
darshanr0107 5083b0c
fix: change label background color to transparent in block styles
darshanr0107 8d38c52
fix: update edge label background handling for markdown compatibilityβ¦
darshanr0107 0ee366e
fix: maintain backward compatibility for markdown label handling in eβ¦
darshanr0107 8bd8039
Revert "fix: maintain backward compatibility for markdown label handlβ¦
darshanr0107 deb4582
fix: simplify text content handling in addText function
darshanr0107 3b730a0
fix: enhance text handling in addText function for class diagrams
darshanr0107 8745456
fix: add labelType markdown for class diagram Nodes
darshanr0107 5438e9c
Revert "fix: add labelType markdown for class diagram Nodes"
darshanr0107 3c118d7
fix: revert changes in shapeUtil
darshanr0107 185ccf0
fix: remove labelType markdown from class diagram edges
darshanr0107 0d1d64e
Revert "fix: remove labelType markdown from class diagram edges"
darshanr0107 1f56f81
Merge branch 'develop' into markdown-specific-changes
darshanr0107 863808f
fix: set labelType to markdown for ER diagram node label
darshanr0107 144794b
fix: set labelType to markdown for class diagram notes
darshanr0107 1336d22
chore:update changeset on-behalf-of: @Mermaid-Chart <hello@mermaidchaβ¦
darshanr0107 7732a23
chore:update changeset on-behalf-of: @Mermaid-Chart <hello@mermaidchaβ¦
darshanr0107 fd3c1b0
Merge branch 'develop' into markdown-specific-changes
ashishjain0512 1384d58
fix: autowrapping in flowchart node labels
darshanr0107 1a18d30
fix: add space after html tag to non markdown text
darshanr0107 9ffe1cf
chore: update changeset
darshanr0107 10d2f77
fix: update handling of markdownAutoWrap to prevent text auto-wrappinβ¦
darshanr0107 a11ca1f
fix: failing unit tests
darshanr0107 c46cb98
fix: autowrapping for edge labels
darshanr0107 9bbb075
fix: update edge label handling to respect markdownAutoWrap configuraβ¦
darshanr0107 40f9993
chore: add tests for auto wrapping of flowchart edge labels
darshanr0107 7d32db1
chore: update changeset
darshanr0107 c7f5850
revert changes to the markdownToLines - No auto wrapping unit tests
darshanr0107 fb6edef
Revert "fix: update edge label handling to respect markdownAutoWrap cβ¦
darshanr0107 5d1e84f
fix: update nonMarkdownToLines to preserve spaces between HTML tags aβ¦
darshanr0107 7517f83
fix: update tests for flowcharts edge label auto wrapping
darshanr0107 b8e7dec
chore:skip the markdownToLines - No auto wrapping test
darshanr0107 0476182
fix: ensure plain text edge labels are not treated as markdown
darshanr0107 ae60bc2
fix: refactor insertEdgeLabel to improve markdown label handling and β¦
darshanr0107 703995a
chore:update Edge label auto-wrapping tests and add nonMarkdownToLineβ¦
darshanr0107 5b1dc43
chore:update edge label autowrapping tests
darshanr0107 dc7e7d8
Merge branch 'develop' into markdown-specific-changes
ashishjain0512 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| 'mermaid': patch | ||
| --- | ||
|
|
||
| fix: respect `markdownAutoWrap: false` to prevent text auto-wrapping in flowchart markdown labels with `htmlLabels` enabled. | ||
|
|
||
| Markdown labels with `markdownAutoWrap: false, htmlLabels: false` set doesn't work | ||
| correctly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| 'mermaid': patch | ||
| --- | ||
|
|
||
| fix: Restore proper rendering of plain text flowchart labels without auto line-wrapping | ||
|
|
||
| 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. | ||
|
|
||
| **What changed:** | ||
|
|
||
| - Plain text labels in flowcharts (without markdown syntax) now render as regular text | ||
| - 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. | ||
| - Plain text labels in other diagrams will continue to not line wrap. | ||
| - Plain text labels with `\n` characters now correctly create line breaks | ||
| - Plain text that looks like markdown (e.g., "1.", "- x") is no longer misinterpreted | ||
|
|
||
| **If you want markdown formatting:** | ||
| You can still use markdown in your flowchart labels by using the proper markdown syntax. Wrap your markdown text with double quotes and backticks: | ||
| ``node["`_markdown_ **text**`"]`` | ||
|
|
||
| Example: | ||
|
|
||
| ````markdown | ||
| ```mermaid | ||
| flowchart TD | ||
| plain["Plain text\nwith manual line break"] | ||
| markdown["`This is a **markdown** _label_ that wraps and doesn't replace \n with newlines`"] | ||
| ``` | ||
| ```` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.