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

Parsing subgraph fails on brackets #68

Open
CGMossa opened this issue Oct 23, 2019 · 1 comment

Comments

@CGMossa
Copy link

@CGMossa CGMossa commented Oct 23, 2019

Using subgraph node_title[Better title] works in the mermaid editor based on 8.40.
It does not work on mmdc.

Example

$ mmdc -i dummy.mmd -o dummy.svg
(node:1616) UnhandledPromiseRejectionWarning: Error: Evaluation failed: Error: Parse error on line 2:
...raph TBsubgraph BIG[better]A-->Bend
----------------------^
Expecting 'SEMI', 'NEWLINE', 'SPACE', 'EOF', 'GRAPH', 'DIR', 'TAGEND', 'TAGSTART', 'UP', 'DOWN', 'subgraph', 'end', 'SQE', 'PE', '-)', 'DIAMOND_STOP', 'MINUS', '--', 'ARROW_POINT', 'ARROW_CIRCLE', 'ARROW_CROSS', 'ARROW_OPEN', 'DOTTED_ARROW_POINT', 'DOTTED_ARROW_CIRCLE', 'DOTTED_ARROW_CROSS', 'DOTTED_ARROW_OPEN', '==', 'THICK_ARROW_POINT', 'THICK_ARROW_CIRCLE', 'THICK_ARROW_CROSS', 'THICK_ARROW_OPEN', 'PIPE', 'STYLE', 'LINKSTYLE', 'CLASSDEF', 'CLASS', 'CLICK', 'DEFAULT', 'NUM', 'PCT', 'COMMA', 'ALPHA', 'COLON', 'BRKT', 'DOT', 'PUNCTUATION', 'UNICODE_TEXT', 'PLUS', 'EQUALS', 'MULT', got 'SQS'
    at Yt.parseError (file:///C:/Users/[CENSORED]/AppData/Local/Yarn/Data/global/node_modules/mermaid.cli/mermaid.min.js:1:486512)
[...]
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
(node:1616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1616) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

where dummy.mmd contains:

graph TB
subgraph BIG[better]
A-->B
end

For example see mermaid live editor with this example.

Finally,

$ mmdc -V
0.5.1
@zerok

This comment has been minimized.

Copy link

@zerok zerok commented Nov 5, 2019

I had a similar issue with hexagonal nodes. The issue seems to be, that mermaid.cli ships with an old version of mermaid.min.js which doesn't support these kinds of node types/attributes. I've solved this by also explicitly installing mermaid and then copying dist/mermaid.min.js into the mermaid.cli folder within node_modules :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.