bpruitt-goddard / vscode-mermaid-syntax-highlight

Markdown syntax support for the Mermaid charting language
MIT License
92 stars 36 forks source link

Refactor/Yaml Rewrite #14

Closed bpruitt-goddard closed 5 years ago

bpruitt-goddard commented 5 years ago

Based on the VS Code docs, the grammar can be re-written in yaml, with a simple conversion step to json for deployment. I followed this guide and converted it, but the guide was wrong for 2 reasons inherent to yaml:

  1. Multi-line strings will have whitespace separating them in the json unless they are double-quoted strings (requiring the whole regex to be escaped).
  2. Comments on multi-line statements aren't valid.

To get around the above and have clean regex statements, I created a custom yaml type that does what the documentation promised. Also, the whole thing is wrapped up in a new convertYaml npm script.

All future development is to be done on the yaml file, with the json file being generated.

This is for issue #13 .