mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
5cfa919672
In order to parse the YAML front-matter in a Mermaid diagram, the YAML seperators **MUST NOT** be indented, e.g.: ````markdown ```mermaid --- title: This is fine. --- ``` ```mermaid --- title: This is not fine, because the `---` are indented. --- ``` ```` However, this makes it very difficult to write nice Mermaid diagrams in HTML code-blocks. This commit uses [`ts-dedent`](https://www.npmjs.com/package/ts-dedent) to automatically remove the indentation from Mermaid diagrams when parsed from HTML. Mermaid diagrams from mermaidAPI.render() are **NOT** dedented, as that API is called from JavaScript code, and therefore users can easily `dedent` their own diagrams.