Mermaid: underscores in labels are no longer supported

Created on 28 Aug 2019  路  6Comments  路  Source: mermaid-js/mermaid

Describe the bug
Upon upgrading from 8.2.3 to 8.2.4 you can no longer use underscores in labels. The results in links to the live editor created last week now leading to an error page

To Reproduce
Steps to reproduce the behavior:
Create a graph using the following:

graph LR

foo[my_lib.foo]
bar[my_lib.bar]
baz[my_lib.qux.baz]

foo --> bar
bar --> baz

Expected behavior
Screenshot 2019-08-28 at 11 06 56

Screenshots
Screenshot 2019-08-28 at 11 08 50

Desktop (please complete the following information):

  • OS: OSX
  • Browser Chrome
  • Version 75

Additional context
The reproduction screenshots were taken using local checkouts of the live editor repo, but
the issue is live at mermaidjs.github.io/mermaid-live-editor

Most helpful comment

Will fix it in 8.2.6 but meanwhile you can simply put the string within quotes like below:

graph LR

foo["my_lib.foo"]
bar["my_lib.bar"]
baz["my_lib.qux.baz"]

foo --> bar
bar --> baz

All 6 comments

Confirming that we've experienced this as well after upgrading from 8.2.3 to 8.2.4.

A workaround is to replace underscores (_) with colons (:) however this potentially requires a project-wide update.

Will fix it in 8.2.6 but meanwhile you can simply put the string within quotes like below:

graph LR

foo["my_lib.foo"]
bar["my_lib.bar"]
baz["my_lib.qux.baz"]

foo --> bar
bar --> baz

@knsv Actually I was mistaken, our error is slightly different from the OP. We get an error when using underscores in class names in 8.2.4. In 8.2.5 it looks like this goes away but occurs instead when using the class name as the first argument to click.

image

Should I create a separate issue for this or do you think these are related and will both be fixed in 8.2.6?

@knsv Thanks! We just ran into this too and will look for 8.2.6.

@knsv Thanks, and kudos on such a quick response/turn-around

Released in 8.2.6

Was this page helpful?
0 / 5 - 0 ratings