Skip to content

Dash character in names breaks the Mermaid diagram output. #183

Closed
@JBBianchi

Description

@JBBianchi

What happened:
States with dash in the name such as:

{
   "id": "helloworld",
   "version": "1.0.0",
   "specVersion": "0.8",
   "name": "Hello World Workflow",
   "description": "Inject Hello World",
   "start": "hello-state",
   "states": [
      {
         "name": "hello-state",
         "type": "inject",
         "data": {
            "result": "Hello World!"
         },
         "end": true
      }
   ]
}

break the Mermaid output produced by new MermaidDiagram(workflow).sourceCode();

What you expected to happen:
A valid mermaid graph.

How to reproduce it:
Try the provided workflow in https://serverlessworkflow.io/editor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions