Using url-link in mermaid node description

I really love the mermaid graphs included in the gitlab markup! We would like to add links to our graphs to link to issues, milestones, wiki pages, external pages etc.

I found several ways to do this, eg using href oder the click keyword, see here: https://stackoverflow.com/questions/41960529/how-to-add-a-link-in-a-mermaid-node-description#51838205

However, it seems that securityLevel has to be set to “loose” in the mermaid configuration for this to work. In the mermaid live Editor I had to enter the following in the “mermaid configuration”-field:

{
  "securityLevel": "loose"
}

which differs a little from the syntax I found in the documentation.

It seems to me that the security level in gitlab prohibits the usage of weblinks in the graph description but I could not figure out how to adjust it. We are funning gitlab-ce 11.8.2 (b1268e9) self hosted.

Anyone has a clue?

Hey there, I know it’s super late, but if you were still interested it looks like the file you need to edit is this one: * render_mermaid.js

1 Like

This links better: https://gitlab.com/gitlab-org/gitlab/-/blob/4799db3b5ddafceefef99427c6b4f5128d2ce087/app/assets/javascripts/behaviors/markdown/render_mermaid.js

Did you ever go back and update your chart with links?

1 Like