Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed erDiagram being whitespace sensitive where it shouldn't #118

Merged
merged 3 commits into from
Nov 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions syntaxes/diagrams/erDiagram.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- comment: '(entity) {'
begin: !regex |-
\s+([\w-]+) # entity name
\s+({) # {
\s*({) # {
beginCaptures:
'1':
name: variable
Expand Down Expand Up @@ -42,12 +42,12 @@
name: keyword.control.mermaid
- comment: '(entity) (relationship) (entity) : (label)'
match: !regex |-
\s*([\w-]+)\s+ # entity
\s*([\w-]+)\s() # entity
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a capture group or should it be a * similar to the other changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, fixed!

((?:\|o|\|\||}o|}\||one or (?:zero|more|many)|zero or (?:one|more|many)|many\((?:0|1)\)|only one|0\+|1\+?) #relationship left
(?:..|--) # relationship identification
(?:o\||\|\||o{|\|{|one or (?:zero|more|many)|zero or (?:one|more|many)|many\((?:0|1)\)|only one|0\+|1\+?))\s+ # relationship right
([\w-]+)\s+ # entity
(:)\s+ # :
(?:o\||\|\||o{|\|{|one or (?:zero|more|many)|zero or (?:one|more|many)|many\((?:0|1)\)|only one|0\+|1\+?))\s* # relationship right
([\w-]+)\s* # entity
(:)\s* # :
((?:"[\w\s]*")|(?:[\w-]+)) # label
captures:
'1':
Expand Down