bpruitt-goddard / vscode-mermaid-syntax-highlight

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

Convert Grammar To Yaml #13

Closed bpruitt-goddard closed 5 years ago

bpruitt-goddard commented 5 years ago

The regex for some things is getting complex. See (\\s*[.'_\\-!#$%^&*+=?,:\\\\/\"\\w\\s]*)?(-?-[-\\>]\\|?|=?=[=\\>]|(?:\\.-|-\\.)-?\\>?|\\|)(\\s*[-\\w]+\\b)(\\[|\\(+|\\>|\\{)?(\\s*[-\\w]+\\b)?(\\]|\\)+|\\})?

Convert the codeblock.json to a yaml file to parse it. See this vs code page about converting it. After converting, move every capture group to separate lines to make it easier to follow.

Additionally, add a command to the npm package to run the converter (with a change to the bad codeblock.json file name).

"scripts": {
        "convertYaml": "npx js-yaml syntaxes/mermaid.tmLanguage.yaml > syntaxes/mermaid.tmLanguage.json"
    },