serverlessworkflow / sdk-typescript

Typescript SDK for Serverless Workflow
https://serverlessworkflow.io/
Apache License 2.0
64 stars 16 forks source link

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

Closed JBBianchi closed 8 months ago

JBBianchi commented 9 months ago

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