Mermaid fails to render a valid stateDiagram

Steps to reproduce

Here is a valid Mermaid graph that works on the live editor.

stateDiagram

[*] --> sm1

state "State Machine 1" as sm1 {

  state "Operation 1" as op1
  state "Operation 2" as op2
  state "State Machine 2" as sm2 {
    state "Operation 3" as op3
    state "Operation 4" as op4
    state "State machine 3" as sm3 {
      state "Operation 5" as op5
      state "Operation 6" as op6
      [*] --> op5
      op5 --> op6
    }
    [*] --> op3
    op3 --> op4
    op4 --> sm3
  }
  [*] --> op1
  op1 --> op2
  op2 --> sm2
}

Expected result

A valid rendered state graph, similar to the preview on Mermaid live editor.

Actual result

Erro parsing Mermaid diagram!

Lexical error on line 9. Unrecognized text.
...e Machine 2" as sm2 {     state "Operati
------------------------^

Environment

  • Operating system:
    MacOS 13.2.1

  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.1.16
    Installer version: v1.1.9
    Operating system: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 22.3.0
    Login status: logged in
    Catalyst license: none
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: none
    Snippets enabled: 0
    Restricted mode: off
    Plugins installed: 1
    Plugins enabled: 1
    1: Templater v1.16.0


Additional information

Looks like it fails parsing composite blocks. It parses single level comosite block incorrectly and fails to parse nested blocks.

Link to a graph

alright, this is probably a bug in the mermaid version we are using. should we fixed when we upgrade to mermaid 10.

will be fixed in v1.4.0

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.