mermaid
mermaid copied to clipboard
Unable to use # or ; in gantt diagram
this doesn't work
gantt
title HASHTEST
THIS#HASH :2021-04-03 11:06:07, 2sec
escaping is also not possible not quoting the text
Just put a # or ; in the THISHASH and you can see the parsing error
https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2FudHRcbiAgICB0aXRsZSBIQVNIVEVTVFxuVEhJU0hBU0ggIDoyMDIxLTA0LTAzIDExOjA2OjA3LCAyc2VjIiwibWVybWFpZCI6e30sInVwZGF0ZUVkaXRvciI6ZmFsc2V9
thanks
Hi! I've just bumped into the same problem. Luckiliy, the solution is described here
You can just use #35;
for # sign and #59;
for ;
my bad, this works in sequenceDiagram, but not in Gantt, sorry.
any update on this ?
technically this should be an easy fix , but getting close to a year . Thanks to check if this is possible
any update ?
Alongside with #
in titles, task headers cannot have #
, %
, ;
, or :
.
I think we need to have a quotation and escaping syntax for them. Like:
gantt
title "project title with \", #, and other special characters"
"task title with \", #, and other special characters" :2021-04-03 11:06:07, 2sec
In my testing, against the current Live Editor (v10.3.0), these are the ones that currently don't work:
-
;
can't be used in any of thetitle
,section
or task names -
:
can't be used insection
or task names, but can be used intitle
-
#
can't be used in task names, and while it won't crash intitle
andsection
it will cause those to be truncated that the first#
Would love to know if anyone finds any other chars that need special handling while we wait for a fix 😄
Thanks.
This seems to be a duplicate/connected with issue #1817. Should these two be connected or should a greater issue be generated to encompass all characters that cannot be used in Gantt labels?
I would like to try tackling this issue.
Is there any reason why on line 89 the parser excludes semicolons and hash symbols? I'm trying to better understand the Jison parser responsible for parsing through the Gantt syntax.
I took the time to clearly document different behaviors caused by different symbols when created a Gantt Diagram. I will be working with the Gantt example provided by the Mermaid Live editor (here). I also made sure to pull the latest changes from the developer branch and ran the developer environment on in FireFox while testing for different situations.
- Placing a
#
or;
at the beginning of the title produces a syntax error and prevents the diagram from rendering. - Placing a
#
after a character in the title (e.g "A G#antt Diagram) renders the diagrams but cuts the title up to the hash (in this case just "A G" is the title). - Placing a
;
after a character in the title produces a syntax error and prevents the diagram from rendering. - Placing
#
at the end of the title (e.g "A Gantt Diagram#") renders everything except the hash (in this case "A Gantt Diagram"). - Placing a
;
at the end of the title produces a syntax error and prevents the diagram from rendering. - Placing a
#
,;
, or:
at the beginning of the section title (e.gsection ;Section
orsection #Section
orsection :Section
) produces a syntax error and prevents the diagram from rendering. - Placing a
#
after a character in the section title (e.gsection S#ection
) renders the diagrams but cuts the section title up to the hash (in this case just "S" is the section title). - Placing a
;
or:
after a character in the section title produces (e.gsection S;ection
orsection S:ection
a syntax error and prevents the diagram from rendering. - Placing
#
at the end of the section title (e.gsection Section#
) renders everything except the hash (in this case "Section"). - Placing a
;
or:
at the end of the section title produces a syntax error and prevents the diagram from rendering. - Placing a
#
in front of a task title caused the following rendering:For context the original diagram looks like this:
- Placing a
:
or:
at the beginning of the task title produces a syntax error and prevents the diagram from rendering. - Placing a
#
or;
after a character in the task title (e.gA t;ask
orA t#ask
) causes a syntax error. - Placing a
:
after a character does allow the diagram to render, but it exhibits the same rendering behavior mentioned in point 11. - Placing a
#
or;
at the end of a task title (e.gA task;
orA task#
) causes a syntax error. - Placing a
:
at the end of a task title (e.gA task:
) does allow the diagram to render, but it exhibits the same rendering behavior mentioned in point 11.
Which of these points are bugs and which ones are acceptable consequences of the parser?