excalidraw / mermaid-to-excalidraw

Generate Excalidraw diagrams from Mermaid
https://mermaid-to-excalidraw.vercel.app
MIT License
265 stars 46 forks source link

\n in mermaid text renders as \n instead of newline #47

Closed skycloudd closed 6 months ago

skycloudd commented 7 months ago

A \n in Mermaid code isnt converted to an actual newline when converted to an Excalidraw diagram

For example:

classDiagram
    note "test 123\ntest 456"

Is converted to:

image

I expect test 456 to be on a new line.

igorwessel commented 6 months ago

@ad1992 wee have anything equivalent in the codebase to convert these escape sequences?

{
  "type": "class",
  "nodes": [
    [
      {
        "type": "rectangle",
        "id": "note0",
        "label": {
          "text": "test 123\\ntest 456",
          "fontSize": 16
        },
        "x": 8,
        "y": 8,
        "width": 214.73333740234375,
        "height": 44.5,
        "subtype": "note",
        "strokeStyle": "dashed"
      }
    ]
  ],
  "lines": [],
  "arrows": [],
  "text": [],
  "namespaces": {}
}