Using "style" in node name causes parse error
See original GitHub issueDescribe the bug Any usage of the word “style” in a node name causes a parsing error. This only happens when the word is lower case.
To Reproduce Steps to reproduce the behavior:
- Create simple graph containing a node with style in it.
graph TD;
a-style-project-name --> using-style-causes-parse-error
style --> style2
Expected behavior I expect to be able to use any word in the node name I want. If it is reserved there should be a way to escape it.
Additional context
Tested with 8.3.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
react-scripts build "Parse error on line 1"
Turns out there was a bug in postcss-calc module that comes with Create React app. I resolved the issue by ignoring that parser....
Read more >Error.prototype.name - JavaScript - MDN Web Docs - Mozilla
The name data property of Error.prototype is shared by all Error instances. ... e.name is 'Error' e.name = "ParseError"; throw e; // e....
Read more >13.2 Parsing HTML documents - HTML Standard - WhatWG
This error occurs if the parser encounters an attribute in a tag that already has an attribute with the same name. The parser...
Read more >Errors | Node.js v19.3.0 Documentation
stackTraceLimit; error.cause; error.code; error.message; error.stack ... The first line of the trace will be prefixed with ${myObject.name}: ...
Read more >Lezer Reference Manual - CodeMirror
Each node in a syntax tree has a node type associated with it. name: string. The name of the node type. Not necessarily...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is a non issue. You can’t do something like
let var = "foo"
in JavaScript, and the same case is true here. The issue is that conceptually mermaid has a textual visual model of the graph, which tends to make the reserved words disappear. My suggestion is to use some sort of naming convention like Hungarian notation to bypass this problem.I am closing this item as “by design” with the idea of not being able to use “reserved” keywords as node names. However, we may still look at providing a way to escape strings per issue #1506