Commit Graph

72 Commits

Author SHA1 Message Date
Jason Dent 4a7489a7b6 chore: Update cspell and fix issues
- covert `cSpell.json` to `cspell.config.yaml`
- break up the word list into multiple dictionary files
- fix spelling issues
- Enable spell checking code for non-test files
2024-02-14 23:17:44 +01:00
Knut Sveidqvist bf64509216 Merge branch 'develop' into 3358-blocks-diagram 2024-01-18 17:07:34 +01:00
Knut Sveidqvist df858dc7b6 #3358 Adding arrows to syntax 2023-11-20 14:00:25 +01:00
Sidharth Vinod 0c0f7a739e
Merge pull request #4934 from RounakJoshi09/bug/#3251_linkStyle-can't-specify-ids
bug/#3251_linkStyle-can't-specify-ids Fixed
2023-11-14 05:38:20 +00:00
Alois Klink 172d90e731 fix(flow): fix invalid ellipseText regex
This invalid regex was causing Mermaid to freeze.
2023-11-06 10:08:12 +00:00
RounakJoshi09 995449cbf6 Error Message Changed 2023-10-11 20:40:14 +05:30
RounakJoshi09 ce3d9fcdde Added test suggested on PR 2023-10-10 11:09:30 +05:30
RounakJoshi09 cdb4639aa4 bug/#3251_linkStyle-can't-specify-ids Fixed 2023-10-10 00:16:05 +05:30
Reda Al Sulais 6f05bf0846
chore: implement actual huge code correctly
Co-authored-by: Alois Klink <alois@aloisklink.com>
2023-09-21 01:26:40 +03:00
Reda Al Sulais 048dc07a90
chore: add comment on why we skip `flow` huge
Co-authored-by: Alois Klink <alois@aloisklink.com>
2023-09-21 01:23:00 +03:00
Reda Al Sulais fc3a8902c0 chore: shorten flow-huge test case using repeat 2023-09-20 16:59:55 +03:00
Knut Sveidqvist 5fc99f1982 #3358 Adding db calls from node statements 2023-08-28 12:51:49 +02:00
Sidharth Vinod 1e0918c2ff
refactor: Remove directives from grammar 2023-08-25 12:55:58 +05:30
Ibrahim Wassouf c9db0ee749 Add specialChars in textNoTagsToken, alphaNumToken
This will ensure that alphaNumToken does not lose any of
the previously used tokens in its definition. The same
tokens were added to textNoTagsToken explicitly, because it used to
have alphaNumToken in its definition before I removed it.

Previously, textNoTagsToken and alphaNumToken had many tokens in
common in their definition. To avoid grammar conflicts, the
alphaNumStatement grammar was created. However, I found this
unintuitive and was an extra step just to avoid repetition in
the definitions.

I opted to have repetition in the definitions of textNoTagsToken
and alphaNumToken and it be explicitly clear right away, rather than
have extra grammar statements like alphaNumStatement which don't look
like they do anything at first glance
2023-08-03 21:05:41 -03:00
Ibrahim Wassouf 850513fa3d Return Unicode Text to idStringToken definition 2023-08-03 20:58:37 -03:00
Ibrahim Wassouf aaf333676c Add underscore to unit test on special Chars 2023-08-03 20:15:11 -03:00
Ibrahim Wassouf ee6fa94aa2 Refactor unit tests and remove repetition 2023-08-03 20:05:11 -03:00
Ibrahim Wassouf 971215e353 Correct idStringToken definition to include all individual special tokens 2023-08-03 19:15:23 -03:00
Ibrahim Wassouf 199fdce982 Add unit tests for node ids with special Chars 2023-08-03 18:59:39 -03:00
Ibrahim Wassouf e3c5e6f095 Modify HREF token regex to contain space
This attempts to maintain the current behaviour.
Previously, because HREF contained a space and called
a state, the href token was able to be placed in the
beginning of node ids (because it wouldn't conflict
without the space). We require the space to keep that
behaviour.
2023-08-01 07:54:48 -03:00
Ibrahim Wassouf ef4f22841f Add unit tests for stange node names 2023-08-01 07:54:32 -03:00
Ibrahim Wassouf 834c67ecaa Remove escaped quotes with backslash feature 2023-07-31 22:47:05 -03:00
Ibrahim Wassouf ed4feaebf2 Remove required space from TAGEND token regex
Originally, I thought this was necessary to prevent parsing
the token as part of an edge. I forgot that the token will always
be separated from the link/edge by the node id. Added an unit test
for an edge case to be certain.
2023-07-29 22:27:31 -03:00
Ibrahim Wassouf bed05ce061 Disallow any vertex shape start or end token in any text state 2023-07-29 21:23:05 -03:00
Ibrahim Wassouf f269f8cc5b Refactor unit tests for vertex shape 2023-07-29 21:14:02 -03:00
Ibrahim Wassouf d8897426cd Correct edge strings to have same configuration as vertex strings 2023-07-27 09:29:26 -03:00
Ibrahim Wassouf fd461b7860 Reimplement old alphaNumToken 2023-07-25 20:56:08 -03:00
Ibrahim Wassouf 30a9b5574d Correct classDef and class grammar
Previously, you were allowed to define a class called 'default'
but were not allowed to use it because the classStatement grammar
expected an alphanum, which did not include the word DEFAULT
2023-07-25 20:35:08 -03:00
Ibrahim Wassouf 20cd685ae3 Allow escaped quotations in strings 2023-07-24 22:43:55 -03:00
Ibrahim Wassouf 47c100809b Add unit tests for all cases of TEXT and STR combinations 2023-07-24 21:46:28 -03:00
Ibrahim Wassouf 651274bc6f Only allow quotes to wrap entire string 2023-07-24 21:23:21 -03:00
Ibrahim Wassouf 4cfbd0d380 Remove unused definitions 2023-07-24 21:05:17 -03:00
Ibrahim Wassouf 45d92769aa Change rest of grammar statements to use variable name instead of position 2023-07-24 21:04:36 -03:00
Ibrahim Wassouf 474e0b9c82 Refactor vertex grammars to use name values instead of position in production 2023-07-23 21:54:42 -03:00
Ibrahim Wassouf 087738df78 Refactor statement grammars to use name values instead of positions in production 2023-07-23 21:39:21 -03:00
Ibrahim Wassouf fa8e02721a Refactor directive grammar to use name instead of position in production 2023-07-23 21:32:52 -03:00
Ibrahim Wassouf 4b9773a272 Refactor token precedence that concern vertex text states 2023-07-23 21:25:19 -03:00
Ibrahim Wassouf fd88b424b4 Add unit test for vertex and edge having both strings and text 2023-07-22 15:09:24 -03:00
Ibrahim Wassouf 3ab0e9998d Remove href state and give call higher precedence
Similar to what was done in the class diagram parser,
this will allow string tokens to appear in any state.
This is especially helpful, because it will simplify the
code and any future refactoring
2023-07-22 14:39:45 -03:00
Ibrahim Wassouf eea0ea5e07 Add unit tests for node id strings with keywords 2023-07-21 21:10:37 -03:00
Ibrahim Wassouf 20011c6882 Add unit tests for edge text 2023-07-21 20:44:37 -03:00
Ibrahim Wassouf 0cc8f89115 Add edgeText states 2023-07-21 19:40:04 -03:00
Ibrahim Wassouf 8ff06e88ce Correct expected error message in unit test 2023-07-21 18:27:20 -03:00
Ibrahim Wassouf 3fa3ed7b18 Remove grammar and unit test that expects HEX token
This was never really used and had many things wrong with it.
I believe that if a hex was provided in the diagram specification,
the alphanum grammar would break it up into a BRKT and NUM token
and use the first line with the addVertex() function.

Second, the styleLink grammar provides the exact same functionality
with the linkStyle keyword.

Third, updateLink() expects an array of nums, not a hex digit.

Fourth, no documentation is provided on this grammar statement existing.
Fifth, the unit test does not work in version 10.2.4
2023-07-21 18:15:43 -03:00
Ibrahim Wassouf 0a4e5f5f6b Slightly alter unit test node idString 2023-07-21 18:15:27 -03:00
Ibrahim Wassouf 0d7cc748b8 Replace alphanum with idString where appropriate 2023-07-21 17:33:33 -03:00
Ibrahim Wassouf 69c91ae5ed Add unit test for edge case with lean_right/left vertices 2023-07-21 00:06:18 -03:00
Ibrahim Wassouf 7adb1bccb3 Replace alphanum with NODE_STRING for most usecases
What this allows is for idStrings that are separated by
dashes or underscores to be considered one whole string
rather than a bunch of tokens mixed together.

This is necessary for examples such as a-node-graph[text].
Now, the last part of the idString 'graph' will be read as
part of the NODE_STRING token rather than attempting to add
a GRAPH token to the idString.
2023-07-20 23:49:43 -03:00
Ibrahim Wassouf 5b987dee93 Put parser in stable state 2023-07-20 13:05:18 -03:00
Ibrahim Wassouf 3496f275bc Re-implement markdown as its own text type 2023-07-19 22:56:53 -03:00