Skip to content
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

Bug Flowchart: Node with text renders by default as Markdown #5824

Open
PLukas2018 opened this issue Sep 6, 2024 · 3 comments · May be fixed by #6087
Open

Bug Flowchart: Node with text renders by default as Markdown #5824

PLukas2018 opened this issue Sep 6, 2024 · 3 comments · May be fixed by #6087
Labels
Good first issue! Graph: Flow Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect

Comments

@PLukas2018
Copy link

PLukas2018 commented Sep 6, 2024

Description

According to documentation, it is possible to create a node with text using Markdown formatting in flowchart diagrams. To do this, the text should be enclosed in quotes and backticks "` text `".

However, it appears that text is being interpreted as Markdown even when it is not enclosed in quotes and backticks. This causes problems when trying to create nodes with text corresponding to unsupported markdown syntax, making it difficult or impossible to display certain texts as plain text in nodes. Examples:

  • 1.
  • - x
  • 1. phase
  • ...

Steps to reproduce

Creating the following diagram in Mermaid results in nodes with error messages instead of displaying the text:

flowchart LR
    a["1."]
    b["- x"]

Screenshots

image

Code Sample

https://develop.git.mermaid.live/edit#pako:eNoti7sOwjAQBH8l2jog0bqmpIKSozjscxzJD2RsAYry7xwKW-2sZhfY4gQGPpaXDVzbcDpTHjR8JRz2hNuGd8Xd8P4zRiSpiWen3-W3EFqQJASj1YnnHhuB8qoq91Yun2xhWu0yopY-BRjP8anUH46bHGeeKqdNWb_qoTDq

Setup

  • Mermaid version: 11.1.0
  • Browser and Version: Chrome, Firefox

Suggested Solutions

  • The text should be displayed as plain text in the node when it is not enclosed in quotes and backticks. The Markdown formatting should only be applied when the text is correctly enclosed.
  • Add support for an escape sequence (e.g., 1\.) to prevent Markdown interpretation.
  • Add an option to turn off Markdown formatting.

Additional Context

No response

@PLukas2018 PLukas2018 added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Sep 6, 2024
@shaloo
Copy link

shaloo commented Sep 7, 2024

Running into the same bug even using Sphinx and mermaid extension. Tried online editor, same issue. All my charts were working fine and now each node says "Unsupported markdown: list".

Tedious Workaround

Remove all 'space' chars from the node name and it works. See first few nodes in the screenshot below. Hope this bug gets fixed soon as I have 3 dozen charts - cant workaround for all.

Screenshot 2024-09-07 at 12 45 44 PM

@candlerb
Copy link

Similarly, if you include a URL in the node text, then it is rendered as "Unsupported markdown: link"

Example: open-telemetry/opentelemetry.io#5168

@jaime-jacob
Copy link

Hello! Myself and a partner would love to work on this for the next few weeks. We are both seniors at the University of Michigan studying computer science. We are new to open-source contributions and are looking for any way to help on this project as we really value the work you are doing. Please let us know if we can pick up this task!

@knsv knsv linked a pull request Nov 27, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue! Graph: Flow Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants