-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Special characters break parsing #54
Comments
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.
I am sure it can be solved. You could count the number of parenthesis I guess or escape them somehow. |
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 |
I see you are running an older version in your example. That issue #8 has been fixed. You can run
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. |
Backslash ("") is another case of special character breaking the parser. Example: |
The problem with backslashes are fixes as of release 0.3.0 |
I just checked out the latest code and it fixed the backslash problem. Thanks :) |
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 not working
working
|
Related it is! Will take a look. |
A fix is committed For the style/% problem. Will be included in the next release. |
Waiting special character implementation, I found this alternative to simulate bracket : "<." and ".>". |
@knsv in the example:
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 |
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 |
@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! |
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). |
Currently Mermaid does not handle special characters inside elements.
Not only is it not allowed, but it also breaks the graph.
Building on a simple demo
I'd like to use something with parenthesis in the text of an element.
I also attempted to use HTML character codes with no result.
The text was updated successfully, but these errors were encountered: