Skip to content

Unable to use :(colon) inside stateDiagram-v2 transition text #7418

@abiriadev

Description

@abiriadev

Proposal

Example diagram code

stateDiagram-v2
    [*] --> pending : enqueued
    pending --> locked : picked up by worker
    locked --> completed : success
    locked --> failed : unrecoverable error
    locked --> pending : recoverable error<br>(ex: timeout, worker shutdown)
Loading

Playground link

Expected result

Something like

stateDiagram-v2
    [*] --> pending : enqueued
    pending --> locked : picked up by worker
    locked --> completed : success
    locked --> failed : unrecoverable error
    locked --> pending : recoverable error<br>(ex#58; timeout, worker shutdown)
Loading

Actual behavior

Error: Error: Parse error on line 6:
...verable error<br>(ex: timeout, worker sh...
-----------------------^
Expecting 'SPACE', 'NL', 'HIDE_EMPTY', 'scale', 'COMPOSIT_STATE', 'STRUCT_STOP', 'STATE_DESCR', 'ID', 'FORK', 'JOIN', 'CHOICE', 'CONCURRENT', 'note', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'CLICK', 'classDef', 'style', 'class', 'direction_tb', 'direction_bt', 'direction_rl', 'direction_lr', 'EDGE_STATE', got 'DESCR'

I think it would be great if there is an escape syntax similar to other diagrams, i.e., wrapping the display text by "(double quote) to prevent such problem.

Suggested example

stateDiagram-v2
    [*] --> pending : enqueued
    pending --> locked : picked up by worker
    locked --> completed : success
    locked --> failed : unrecoverable error
    locked --> pending : "recoverable error<br>(ex: timeout, worker shutdown)"
Loading

Screenshots

Image

Might be related

#1266 #4175 #2499

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions