Skip to content

Commit

Permalink
feat(graph): support sub graph with id
Browse files Browse the repository at this point in the history
  • Loading branch information
bpruitt-goddard committed Apr 13, 2024
1 parent 65e0894 commit 66e93a3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
20 changes: 19 additions & 1 deletion syntaxes/diagrams/graph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@
patterns:
- match: \%%.*
name: comment
- match: \b(subgraph)\s+([\p{Letter}\ 0-9]+)
- comment: ''
match: !regex |-
\b(subgraph)\s+
(\w+)
(\[)
("?[\w\s*+%=\\/:\.\-'`,&^#$!?<>]*"?)
(\])
captures:
'1':
name: keyword.control.mermaid
'2':
name: variable
'3':
name: keyword.control.mermaid
'4':
name: string
'5':
name: keyword.control.mermaid
- match: \b(subgraph)\s+([\p{Letter}\ 0-9<>]+)
captures:
'1':
name: keyword.control.mermaid
Expand Down
8 changes: 8 additions & 0 deletions tests/diagrams/graph.test.mermaid
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ graph TB
多电压测试1
%% ^^^^^^^^^ variable
end
%%~~~ keyword.control.mermaid
subgraph a["<a>"]
%%^^^^^^^^ keyword.control.mermaid
%% ^ variable
%% ^ keyword.control.mermaid
%% ^^^^^ string
%% ^ keyword.control.mermaid
end
%%~~~ keyword.control.mermaid
end
%% <--- keyword.control.mermaid

0 comments on commit 66e93a3

Please sign in to comment.