diff --git a/Mermaid Flowchart.sublime-syntax b/Mermaid Flowchart.sublime-syntax index d35a40c..04c2250 100644 --- a/Mermaid Flowchart.sublime-syntax +++ b/Mermaid Flowchart.sublime-syntax @@ -16,6 +16,9 @@ contexts: scope: punctuation.terminator.flowchart main: + - match: ^---$ + scope: punctuation.section.block.begin.graph.mermaid + push: config - include: style - match: ^\s*(click)\s+ captures: @@ -242,14 +245,16 @@ contexts: captures: 1: keyword.declaration.styling.graph.mermaid 2: entity.name.constant.styling.graph.mermaid - embed: scope:source.css.mermaid#property-list-body + embed: scope:source.css.mermaid#rule-list-body + embed_scope: source.css.embedded escape: $ - - match: ^\s*(style)\s+({{entity}})\s+ + - match: ^\s*(style|linkStyle)\s+({{entity}})\s+ captures: 1: keyword.declaration.styling.graph.mermaid 2: variable.parameter.graph.mermaid - embed: scope:source.css.mermaid#property-list-content + embed: scope:source.css.mermaid#rule-list-body + embed_scope: source.css.embedded escape: $ class-expect-node-name: @@ -289,3 +294,9 @@ contexts: escape_captures: 0: punctuation.definition.string.end.mermaid #pop: 1 + + config: + - match: ^---$ + scope: punctuation.section.block.end.graph.mermaid + pop: 1 + - include: scope:source.yaml diff --git a/tests/syntax_test_flowchart.mermaid b/tests/syntax_test_flowchart.mermaid index bcb6efc..2e43516 100644 --- a/tests/syntax_test_flowchart.mermaid +++ b/tests/syntax_test_flowchart.mermaid @@ -310,6 +310,15 @@ flowchart LR click A call callback() "Tooltip for a callback" click B href "https://www.github.com" "This is a tooltip for a link" +--- +config: + markdownAutoWrap: false +%%^^^^^^^^^^^^^^^^ meta.mapping.key meta.string string.unquoted +%% ^ meta.mapping punctuation.separator.key-value.mapping +%% ^^^^^ constant.language.boolean.false +--- +%%^ source.mermaid.flowchart punctuation.section.block.end.graph.mermaid + flowchart LR A-->B B-->C @@ -319,3 +328,18 @@ flowchart LR click B "https://www.github.com" "Open this top" _top click C href "https://www.github.com" _parent click D href "https://www.github.com" "Open this in a new tab" _blank + + linkStyle 0 stroke:#BBDEFB,fill:none +%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.mermaid.flowchart +%% ^^^^^^^^^ keyword.declaration.styling.graph.mermaid +%% ^ variable.parameter.graph.mermaid +%% ^^^^^^^^^^^^^^^^^^^^^^^^ source.css.embedded +%% ^^^^^^ meta.property-name.css support.type.property-name.css +%% ^ punctuation.separator.key-value.css +%% ^^^^^^^ meta.property-value.css constant.other.color.rgb-value.css +%% ^ punctuation.definition.constant.css +%% ^ punctuation.terminator.rule.css.mermaid +%% ^^^^ meta.property-name.css support.type.property-name.css +%% ^ punctuation.separator.key-value.css +%% ^^^^ meta.property-value.css constant.language.null.css +%% ^ - source.css