Mermaid CLI – how do you escape characters?

Use quotation marks "" to enclose your text and escape special characters, e.g. in your example:

graph TD

    question1{"Gas tank less than 1/8?"}
    action1["Fill tank to 100%"]

    question1-- Yes -->action1

will produce this diagram:

enter image description here

This is now documented in the official documentation.

Leave a Comment