Comments (14)
I see the problem. Those characters are a bit tricky as they also are the elements that end the text in the node.
For instance in the simple example below the naïve parser will think the node has ended after the x) and will look after a link.
a(f(x))
I am sure it can be solved. You could count the number of parenthesis I guess or escape them somehow.
I'm open to someone submitting something like this as a pull request.
from mermaid.
It's not just special characters. I have a process called RTD in my software. When I try to make a node B(RTD) I get an error. B(R T D) works, B(R TD) does not work, B(RTD) does not work. Compare http://ABLsaurusRex.jsbin.com/qahofe/1 with
http://ABLsaurusRex.jsbin.com/lugucu/1 .
from mermaid.
I see you are running an older version in your example. That issue #8 has been fixed. You can run
mermaid.version();
In the javascript console to see the version. This issue was fixed in 0.2.14. I hope this solves your problem @ABLsaurusRex. No fix yet for the (,),[,] characters though.
from mermaid.
Backslash ("") is another case of special character breaking the parser. Example:
graph LR;
A[Domain\User1]-->B(Thing);
from mermaid.
The problem with backslashes are fixes as of release 0.3.0
from mermaid.
I just checked out the latest code and it fixed the backslash problem. Thanks :)
from mermaid.
I believe this is related, so I'll file under this issue, but happy to separate into its own issue if that is better. So far, it seems style
and %
breaks the style parser, so here are some examples.
not working
graph TD;
classDef exClass font-style:bold;
a-->b;
class a exClass;
graph TD;
classDef exClass font-size:50%;
a-->b;
class a exClass;
working
graph TD;
classDef exClass font-family:monospace;
a-->b;
class a exClass;
graph TD;
classDef exClass font-size:10px;
a-->b;
class a exClass;
from mermaid.
Related it is! Will take a look.
from mermaid.
A fix is committed For the style/% problem. Will be included in the next release.
(This is now included in release 0.3.2)
from mermaid.
Waiting special character implementation, I found this alternative to simulate bracket : "<." and ".>".
from mermaid.
@knsv in the example:
graph TD
question1{Gas tank less than 1/8?}
action1[Fill tank to 100%]
question1-- Yes -->action1
An error is thrown, very similar to @TripleDogDare, maybe there should be parsing logic to handle html entities altogether?
Referenced from: http://stackoverflow.com/questions/28121525/mermaid-cli-how-do-you-escape-characters
from mermaid.
Hi Chase! Thanks for bringing this up. I expect there several other that are experiencing the same thing. I have added % as a valid text character so with the next release this will work. Perhaps we should sum thing up and do bigger fix for the characters. Right now its one at a time when they pop up.
Anyways, with 0.3.3 this will work
from mermaid.
@knsv great turn around time! I agree, it'd be a really good idea to gather up all special characters that are processed as tags and make sure they're handled properly when it's appropriate.
This is a really cool product, nice work!
from mermaid.
I am going through issues and am closing this one. I think special characters are now much improved with the fix allowing any characters within quotes (#162).
from mermaid.
Related Issues (20)
- adding Markdown to SequenceDiagram Notes
- sankey with showValues enabled results in unnecessary crossing of lines
- Please modify the mindmap style. HOT 2
- Allow user to disable setting of certain CSS styles
- YouTube `<iFrame>` doesn't render. HOT 2
- nested block diagram's dynamic width not worked as expected
- Misleading doc statement about state diagram?
- mermaid.ink server is down HOT 1
- Named composite example in State Diagram HOT 1
- Image not rendering in mermaid live HOT 1
- KaTeX does not render on GitHub HOT 3
- Tag a commit separate from the line defining the commit in gitGraph HOT 1
- Add support for nested namespaces
- The diagram renders only once. HOT 1
- How to put URL in timeline ?
- Bad Gantt Chart Will Cause UI to Hang
- Please add data attributes `data-from-id` and `data-to-id` to `g class='edgeLabel'` svg / make it clickable in flowchart HOT 1
- Parsing error when assigning a hex color value to the last attribute of a linkStyle
- Proyecto grabación de pantalla
- Allow linkStyle background-color attribute to override edgeLabel class background-color HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mermaid.