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

Weird bug in live editor when using words with substring end #184

Closed
sbussard opened this issue Jul 9, 2015 · 3 comments · Fixed by #224
Closed

Weird bug in live editor when using words with substring end #184

sbussard opened this issue Jul 9, 2015 · 3 comments · Fixed by #224
Labels
Type: New Shape Request for new shape

Comments

@sbussard
Copy link

sbussard commented Jul 9, 2015

The live editor breaks when trying to process this

graph LR
A --> Calendar

screen shot 2015-07-09 at 9 26 11 am

@sbussard
Copy link
Author

sbussard commented Jul 9, 2015

actually this breaks

graph LR  

A --> end

@sbussard sbussard changed the title Weird bug Weird bug in live editor using end Jul 9, 2015
@sbussard sbussard changed the title Weird bug in live editor using end Weird bug in live editor when using words with substring end Jul 9, 2015
@knsv
Copy link
Collaborator

knsv commented Jul 11, 2015

Thanks for bringing this up. It must be because end is also a keyword for subgraphs. I will take a look at it.

@knsv
Copy link
Collaborator

knsv commented Jul 15, 2015

Not so easy to fix I'm afraid. You can have keywords in text though so an easy workaround would be:

graph LR
A --> B[Calendar]

I hope this suffices, will put this issue as won't fix as there is the simple workaround.

@knsv knsv added the Type: New Shape Request for new shape label Jul 15, 2015
spect88 added a commit to spect88/mermaid that referenced this issue Oct 14, 2015
Jison adds \b (word boundary) to literal string patterns by default.
It does so, because it doesn't follow traditional match-longest
approach, but does match-first instead. Without including word
boundaries, it'd be hard to distinguish between a keyword and
identifier.

The pattern for `end` keyword is not a simple string literal - it
swallows trailing whitespace, so we have to add \b manually.

This partially fixes mermaid-js#184 - at least now `end` behaves the same as other
keywords: it can be used as a prefix and infix, but not as a suffix.

To solve this issue completely, ALPHA pattern would have to match
multiple letters, which is a much bigger change.
@knsv knsv closed this as completed in #224 Oct 15, 2015
mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
…yarn/develop/macfja/svelte-persistent-store-1.1.1

Bump @macfja/svelte-persistent-store from 1.1.0 to 1.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Shape Request for new shape
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants