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

Error when rendering A-- This is the text -- B #102

Closed
npatmaja opened this issue Jan 14, 2015 · 6 comments
Closed

Error when rendering A-- This is the text -- B #102

npatmaja opened this issue Jan 14, 2015 · 6 comments

Comments

@npatmaja
Copy link

I am experiencing an error while parsing text on link (copy pasted from flowchart basic syntax) using mermaid 0.3.2

A-- This is the text -- B

the error is:

Uncaught Error: Parse error on line 2:
...his is the text -- B
-----------------------^
Expecting 'GRAPH', 'SPACE', 'DIR', 'TAGEND', 'TAGSTART', 'subgraph', 'end', 'MINUS', '--', '==', 'STYLE', 'LINKSTYLE', 'CLASSDEF', 'CLASS', 'CLICK', 'NUM', 'COMMA', 'ALPHA', 'COLON', 'BRKT', 'DOT', 'PLUS', 'EQUALS', 'MULT', got 'EOF'

However, mermaid renders perfectly A---|This is the text|B; syntax.
Is -- This is the text -- no longer supported? if so please change the documentation.

@knsv
Copy link
Collaborator

knsv commented Jan 14, 2015

I see the problem. There were no test case for that syntax. Will look at it.

@knsv
Copy link
Collaborator

knsv commented Jan 14, 2015

So text can contain -- and it can contain space. So the ending element " --" is hard for the parser to separate from text.

I can see that having things like

count--

in the boxes makes sense.

Right now it works --- as ending. Perhaps thats the way to go or perhaps forbidding -- in text is the best option. I am open for opinions.

@npatmaja
Copy link
Author

I think having --- as ending will do as the other lines with text also use three characters as ending, e.g., .-> or ==>.
Another alternative is to have this kind of syntax:

A--|some long text that uses escaped char like `||--B

Please let me know your opinion.

@knsv
Copy link
Collaborator

knsv commented Jan 15, 2015

Then think I will update the docs showing the ---as ending!

@npatmaja
Copy link
Author

Cool! thanks. I'll download the latest library :)

@knsv
Copy link
Collaborator

knsv commented Jan 31, 2015

I think this one should be closed as of 0.3.3. @npatmaja, I saw your guide for using mermaid with docpad, nice work!

@knsv knsv closed this as completed Jan 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants