Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Markdown lists are not supported #6099

Open
Timac opened this issue Nov 29, 2024 · 6 comments
Open

Markdown lists are not supported #6099

Timac opened this issue Nov 29, 2024 · 6 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@Timac
Copy link
Contributor

Timac commented Nov 29, 2024

Description

Markdown lists are not supported in Mermaid diagrams. When using a Markdown list in a diagram, you will see the error Unsupported markdown: list

Steps to reproduce

Example with '-'

  1. Create a graph using a Markdown list
flowchart LR
    A[Node 1] --> B["`- Line1
    - Line 2
    - Line 3`"]
  1. You see the error Unsupported markdown: list when the graph is rendered:
flowchart LR
    A[Node 1] --> B["`- Line1
    - Line 2
    - Line 3`"]
Loading

Example with '*'

  1. Create a graph using a Markdown list
flowchart LR
    A[Node 1] --> B["`* Line1
    * Line 2
    * Line 3`"]
  1. You see the error Unsupported markdown: list when the graph is rendered:
flowchart LR
    A[Node 1] --> B["`* Line1
    * Line 2
    * Line 3`"]
Loading

Setup

  • Mermaid version: 11.4.1
  • Browser and Version: Reproduced with Chrome and Safari

Workaround

A workaround is not to use characters like or :

flowchart LR
    A[Node 1] --> B["`• Line1
    • Line 2
    • Line 3`"]

is rendered as

flowchart LR
    A[Node 1] --> B["`• Line1
    • Line 2
    • Line 3`"]
Loading
flowchart LR
    A[Node 1] --> B["`- Line1
    - Line 2
    - Line 3`"]

is rendered as

flowchart LR
    A[Node 1] --> B["`- Line1
    - Line 2
    - Line 3`"]
Loading
@Timac Timac added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Nov 29, 2024
@KevinWang15
Copy link

KevinWang15 commented Jan 20, 2025

I downgraded mermaid to workaround this issue

{
  "dependencies": {
    "mermaid": "^10",
  }
}

@Timac
Copy link
Contributor Author

Timac commented Jan 20, 2025

@KevinWang15 Nice catch. This bug is indeed a regression from Mermaid 10 to Mermaid 11.
Here is how the following diagram is rendered:

flowchart LR
    A[Node 1] --> B["- Line1
    - Line 2
    - Line 3"]
  • Mermaid 10.9.3 ✅

Image

  • Mermaid 11.0.0-alpha.7 ✅

Image

Mermaid 11.0.0 ❌

Image

@digitalmoksha
Copy link

@Timac I actually don't think this is a bug. The example you gave

```mermaid
flowchart LR
    A[Node 1] --> B["- Line1
    - Line 2
    - Line 3"]
```

is not using the correct syntax to invoke markdown on 10.x. There you need

```mermaid
flowchart LR
    A[Node 1] --> B["`- Line1
    - Line 2
    - Line 3`"]
```

and when I run that on our 10.x installation, I get the same unsupported error. And the reason you get that error on 11.x with your example, is that they are ALWAYS processing markdown now, whether you have special syntax or not. At least from my testing.

I think in general, for both 10.x and 11.x, they do not support block level markdown, such as lists, blockquotes, etc. Only inline markdown, such as bold, italics, etc. Much like standard markdown tables, which also only support inline markdown.

@pfych
Copy link

pfych commented Mar 7, 2025

Having this issue even with non-markdown labels

flowchart
    subgraph Corporate Network
        LDAP[LDAP-Based Identity Store] <-- "2. Authenticate" --> IDP
        User -- "1. App makes auth request" --> IDP["Portal/Identity Provider (IdP)"]
        IDP -- "3. SAML Assertion" --> User
    end
    
    subgraph AWS Cloud
        STS -- "5. Temporary Security Credentials" --> User
        User -- "4. AssumeRoleWithSAML API" --> STS("Secure Token Service (STS)")
        User -- "6. Access AWS" --> S3
        S3
    end
Image

@claremacrae
Copy link

For the list item case, I found a workaround to restore the previous behaviour: put a \ before the character that was interpreted as being a list item:

-2["- [ ] do this first 🆔 abcdef"]:::TASK
+2["\- [ ] do this first 🆔 abcdef"]:::TASK

See the diffs in context in this commit:

And screenshots showing before-and-after here:

@digitalmoksha
Copy link

digitalmoksha commented Mar 7, 2025

Here is the bug issue opened by @ajuckel about processing labels as markdown even when not using their documented syntax. #6275. There are even a couple PRs to attempt to fix it.

@pfych, as @claremacrae pointed out, with markdown you can escape characters that are part of markdown syntax by using a \ in front of them. So you could change your labels, for example, to "2\. Authenticate"

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

5 participants