mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
71.53k stars 6.48k forks source link

Gantt Diagrams SVG Output Non-functional Click Event #2077

Open markjohn opened 3 years ago

markjohn commented 3 years ago

Describe the bug If I create a gantt diagram using a "click" event coupled to a node, the resulting SVG output does not have a functional link. While in a "graph TD" diagram, the click event works as expected in the SVG output.

To Reproduce I recreated this issue in the Mermaid Live Editor. The following generates a functional link when the output is saved to an SVG:

graph TD; a[Functional Link] click a href "http://www.github.com"

While the following creates an SVG file which appears to have a link (cursor appears to change when hovering), but clicking the link doesn't appear to do anything:

gantt dateFormat YYYY-MM-DD
Non-functional Link :a, 2021-05-17,5d click a href "http://www.github.com"

Expected behavior Consistent SVG output functionality regardless of the diagram type.

Additional context The rendered gantt html in the live editor has a functional click event in the node, but when saved to an SVG file, the click functionality is somehow lost. Consistent behavior is produced in mermaid-cli created SVG files for both of the code snippets above.

pkcpkc commented 3 years ago

This seems to be only party true for usage of the mermaidAPI, see #2152 Interaction seems to be working with inline usage.

Did you set the securityLevel to 'loose'?