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)
- Let user see only on the interested terms
- using mermaid in vue3[svgElem.node(...).getBBox]
- Elk renderer not wokring on empty subgraph HOT 2
- Bump Typescript-Eslint version To V7 HOT 1
- block diagram column counting error HOT 1
- Overlapping Arrow Edges in Large Entity Relationship Diagrams HOT 1
- Typing a semicolon creates a new state node instead of being included in the transition text
- Unexpected rendering of message arrows in sequence diagrams
- The Relation height changed from v10.4.0 - v10.5.0 for class diagrams HOT 2
- Hash "#" symbol as prefix is not working for sequenceDiagram HOT 1
- Add positioning for elk layout renderer. This can enable Horizontal Order and Vertical Order
- Add `switch` as alias of `checkout` to gitGraph Syntax
- Block diagram group title should be rendered above of inner blocks HOT 1
- vdots hline array{c|c} (vertical lines) do not render HOT 2
- Add support for mermaidOptions in mermaid.render HOT 1
- click action for subgraphs
- Tooltips for emoji in Diagram Syntax doc tree
- Math is occasionally rendered incorrectly (e.g., fraction inside sqrt)
- log scale for `xychart-beta`
- Unable to Style Sequence Diagram Title
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.