mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
72.78k stars 6.65k forks source link

Multiline does not work since v11 #6048

Open pinage404 opened 2 weeks ago

pinage404 commented 2 weeks ago

Description

Multiline are not suported anymore

Until 10.9.3, it was ok

image

Starting since 11.0.0, multiline are not supported anymore image

Even in the last release 11.4.0 image

Even the develop branch

Steps to reproduce

  1. add a \n in a label
  2. observe that the newline is not rendered, \n is displayed as plain text

Screenshots

No response

Code Sample

flowchart TD
    A[Christmas] -->|Get money| B(Go shopping)
    B --> C{Let me\nthink}
    C -->|One| D[Laptop]
    C -->|Two| E[iPhone]
    C -->|Three| F[fa:fa-car Car]

Setup

Suggested Solutions

No response

Additional Context

No response

daveyarwood commented 1 week ago

I noticed this as well in Notion:

Screenshot 2024-11-18 at 1 05 36 PM

Whereas up until recently, \n inside a label was rendered as a newline.

EDIT: That second MultipleLines line isn't really necessary. I took it out and the behavior is the same -- the issue is still reproduced.