# Mermaid diagrams support

**URL:** <https://forum.xwiki.org/t/mermaid-diagrams-support/7421>\
**Category:** Help / Discuss\
**Created:** [September 2, 2020, 3:50pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421 "2020-09-02T15:50:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![siller.glow](https://forum.xwiki.org/user_avatar/forum.xwiki.org/siller.glow/32/2928_2.png) [@siller.glow](https://forum.xwiki.org/u/siller.glow)\
**Post date:** [September 2, 2020, 3:50pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/1 "2020-09-02T15:50:24Z")

</div>

Dea XWiki. Let me ask if you plan to support Mermaid diagramm. A very useful and simple tool for complex topics such as displaying charts. I believe this would be a very useful extension for many users of your system.

> **[Mermaid | Diagramming and charting tool](http://mermaid.js.org/)**
>
> Create diagrams and visualizations using text and code.

![image](https://forum.xwiki.org/uploads/default/original/2X/b/b414c95aa62fda05d999a747b7f48f07f82dbfbd.png)

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 2, 2020, 4:18pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/2 "2020-09-02T16:18:09Z")

</div>

PS: Please use the “Help/Discuss” category for discussions/questions when you post. I’ve updated your post.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 2, 2020, 4:20pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/3 "2020-09-02T16:20:41Z")

</div>

> [@siller.glow](#):
>
> Let me ask if you plan to support Mermaid diagramm.

There’s no plan but it would be nice indeed. Maybe you could develop it?

We do support several diagrams already though. For ex:

- [https://extensions.xwiki.org/xwiki/bin/view/Extension/PlantUML+Macro](https://extensions.xwiki.org/xwiki/bin/view/Extension/PlantUML+Macro)
- [https://extensions.xwiki.org/xwiki/bin/view/Extension/Sequence%20Diagram%20Macro](https://extensions.xwiki.org/xwiki/bin/view/Extension/Sequence%20Diagram%20Macro)
- [https://extensions.xwiki.org/xwiki/bin/view/Extension/YUML%20Macro](https://extensions.xwiki.org/xwiki/bin/view/Extension/YUML%20Macro)

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [September 2, 2020, 4:22pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/4 "2020-09-02T16:22:36Z")

</div>

> [@vmassol](#):
>
> There’s no plan but it would be nice indeed.

FYI, I’ve created an issue for it at [Loading...](https://jira.xwiki.org/browse/EXOIDEA-5)

---

<div class="post-metadata">

**Author:** ![siller.glow](https://forum.xwiki.org/user_avatar/forum.xwiki.org/siller.glow/32/2928_2.png) [@siller.glow](https://forum.xwiki.org/u/siller.glow)\
**Post date:** [September 2, 2020, 4:27pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/5 "2020-09-02T16:27:48Z")

</div>

i like XWiki more and more, thank you for you support ) UML and YAML its also that’s what i need. Mermaid will be very helpful too.

---

<div class="post-metadata">

**Author:** ![HamsterNL](https://forum.xwiki.org/user_avatar/forum.xwiki.org/hamsternl/32/19_2.png) [@HamsterNL](https://forum.xwiki.org/u/HamsterNL)\
**Post date:** [February 19, 2021, 4:34pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/6 "2021-02-19T16:34:25Z")

</div>

+1 for Mermaid diagrams! I have also upvoted the JIRA 🙂

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [February 19, 2021, 4:42pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/7 "2021-02-19T16:42:45Z")

</div>

And I’ve proposed it as a GSOC at:

- 2021: [https://dev.xwiki.org/xwiki/bin/view/GoogleSummerOfCode/#HMermaidIntegration](https://dev.xwiki.org/xwiki/bin/view/GoogleSummerOfCode/#HMermaidIntegration)
- 2019: [https://dev.xwiki.org/xwiki/bin/view/GoogleSummerOfCode/GoogleSummerOfCode2019#HMermaidIntegration](https://dev.xwiki.org/xwiki/bin/view/GoogleSummerOfCode/GoogleSummerOfCode2019#HMermaidIntegration)

---

<div class="post-metadata">

**Author:** ![jingkaimori](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@jingkaimori](https://forum.xwiki.org/u/jingkaimori)\
**Post date:** [March 4, 2021, 3:01pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/8 "2021-03-04T15:01:40Z")

</div>

I tried to develop a mermaid render macro and published it [on github](https://github.com/jingkaimori/xwiki-mermaid).But there are still some issue:

- How to edit the source of diagram in WISIWYG editor and inplace editor?
- How to implement a live editor?
- How to display error message in two editor mode(WISIWYG and inplace)?

---

<div class="post-metadata">

**Author:** ![siller.glow](https://forum.xwiki.org/user_avatar/forum.xwiki.org/siller.glow/32/2928_2.png) [@siller.glow](https://forum.xwiki.org/u/siller.glow)\
**Post date:** [May 12, 2021, 4:03pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/9 "2021-05-12T16:03:05Z")

</div>

I very rarely use the WISIWYG for PlantUML, at least the built-in XWiki. I believe that for Mermaid this is a minor inconvenience compared to the ability to use Mermaid diagrams. Third-party LiveEditor will allow you to debug complex diagrams and perhaps later it will be possible to teach WISIWYG for make Mermaid too. In the meantime, even just supporting Mermaid will give me significant benefits of using XWiki.

---

<div class="post-metadata">

**Author:** ![siller.glow](https://forum.xwiki.org/user_avatar/forum.xwiki.org/siller.glow/32/2928_2.png) [@siller.glow](https://forum.xwiki.org/u/siller.glow)\
**Post date:** [November 1, 2021, 6:17am UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/10 "2021-11-01T06:17:28Z")

</div>

Look, Kroki is better. Thx for Daniel Beland ( [Loading...](https://jira.xwiki.org/browse/EXOIDEA-5)) for what prompted such a wonderful idea

[https://kroki.io/](https://kroki.io/)

---

<div class="post-metadata">

**Author:** ![xinnj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/x/eada6e/32.png) [@xinnj](https://forum.xwiki.org/u/xinnj)\
**Post date:** [February 28, 2025, 2:47pm UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/11 "2025-02-28T14:47:00Z")

</div>

OK, you can try to search `mermaid` on extension manager now.

---

<div class="post-metadata">

**Author:** ![siller.glow](https://forum.xwiki.org/user_avatar/forum.xwiki.org/siller.glow/32/2928_2.png) [@siller.glow](https://forum.xwiki.org/u/siller.glow)\
**Post date:** [March 3, 2025, 6:08am UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/12 "2025-03-03T06:08:28Z")

</div>

Very nice, i play with like a child. Let me elaborate, when i try use “sequenceDiagram” got error. What i do wrong?

![image](https://forum.xwiki.org/uploads/default/original/2X/3/34447e9c85d79625164180d95e609fe8036cca37.png)

for example:

```auto
{{mermaid}}
sequenceDiagram
    Alice->>Bob: Hello Bob, how are you ?
    Bob->>Alice: Fine, thank you. And you?
    create participant Carl
    Alice->>Carl: Hi Carl!
    create actor D as Donald
    Carl->>D: Hi!
    destroy Carl
    Alice-xCarl: We are too many
    destroy Bob
    Bob->>Alice: I agree
{{/mermaid}}

```

---

<div class="post-metadata">

**Author:** ![xinnj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/x/eada6e/32.png) [@xinnj](https://forum.xwiki.org/u/xinnj)\
**Post date:** [March 28, 2025, 6:04am UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/13 "2025-03-28T06:04:43Z")

</div>

I opened an issue for mermaid:

> <https://github.com/mermaid-js/mermaid/issues/6429>
>
> \### Description
> 
> When drawing sequenceDiagram as prototype.js is used at the sam…e time, a syntax error will be returned.
> 
> \### Steps to reproduce
> 
> The code below will not work, and will work if prototype.js is removed.
> \`\`\`
> \<html\>
> \<head\>
> \<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.3.0/prototype.js"\>\</script\>
> \</head\>
> \<body\>
> Here is one mermaid diagram:
> 
> \<pre class="mermaid"\>
> sequenceDiagram
> participant A as Alice
> participant J as John
>     
> A-\>\>J: Hello John, how are you?
> loop Healthcheck
> J-\>\>J: Fight against hypochondria
> end
> Note right of J: Rational thoughts \<br/\>prevail...
> alt is sick?
> J-\>\>J: Drink the medicine
> else is moody?
> J-\>\>J: Keep smiling!
> else is sad?
> J-\>\>J: Eat chocolate!
> end
> opt no one is home
> J--\>\>J: check VM on return
> end
> J--\>\>A: Great! around
> \</pre\>
> \<script type="module"\>
> import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/+esm';
> mermaid.initialize({ startOnLoad: true })
> \</script\>
> 
> \</body\>
> \</html\>
> \`\`\`
> 
> \### Screenshots
> 
> \_No response\_
> 
> \### Code Sample
> 
> \`\`\`text
> 
> \`\`\`
> 
> \### Setup
> 
> \- Mermaid version:
> \- Browser and Version: \[Chrome, Edge, Firefox\]
> 
> \### Suggested Solutions
> 
> \_No response\_
> 
> \### Additional Context
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![xinnj](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/x/eada6e/32.png) [@xinnj](https://forum.xwiki.org/u/xinnj)\
**Post date:** [April 9, 2025, 9:03am UTC](https://forum.xwiki.org/t/mermaid-diagrams-support/7421/14 "2025-04-09T09:03:45Z")

</div>

Finally, found the conflict and fixed it.  
V1.1 should work.
