You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a diagram with several boxes with long text that I would like to break in the middle to create taller, narrower boxes. Several references (https://jojozhuang.github.io/tutorial/mermaid-cheat-sheet/ for one) indicate to use break symbols (<br> and <br/>) to split long lines of text in Mermaid. These also work in the Mermaid Live Editor (https://mermaid.live/).
However, it does not have the desired effect in the Grafana Diagram plugin; the break symbol shortens the box, but the text is not split. Please see the attached images for examples of what occurs both without and with the break symbols. Both forms appears to be recognized, as they both shorten the respective boxes.
We are running Grafana v8.4.7 and Diagram v1.7.3.
.
The text was updated successfully, but these errors were encountered:
It looks like it strips out all HTML in the node's text, I have some <img> tags which render fine, but when I then add a metric to the node it gets rid of the image.
If you put the escaped symbols for the desired HTML formatting inside the Mermaid diagram definition, then once you apply the metric onto that node, then it'll un-escape the HTML and the HTML will work again.
In your example, you wanted the name to be Post-Initial<br>Page Refresh. If you set this as Post-Initial<br>Page Refresh then once you apply the metric it'll render how you wanted.
This falls apart if you have long HTML content, for instance, say you had an image on the node: "<img src='https://www.mywebsite.com/image.png'; width='30';>br NodeName", then Mermaid will end up rendering a reeeeeaally wide node expecting that the HTML tag was actually the text inside the node. So it's only really applicable for cases like yours.
I have a diagram with several boxes with long text that I would like to break in the middle to create taller, narrower boxes. Several references (https://jojozhuang.github.io/tutorial/mermaid-cheat-sheet/ for one) indicate to use break symbols (<br> and <br/>) to split long lines of text in Mermaid. These also work in the Mermaid Live Editor (https://mermaid.live/).
However, it does not have the desired effect in the Grafana Diagram plugin; the break symbol shortens the box, but the text is not split. Please see the attached images for examples of what occurs both without and with the break symbols. Both forms appears to be recognized, as they both shorten the respective boxes.
We are running Grafana v8.4.7 and Diagram v1.7.3.
.
The text was updated successfully, but these errors were encountered: