Mermaid code blocks not drawing in Confluence? Turn them into diagrams
Confluence shows a Mermaid code block as plain code and never draws it. To get diagrams, replace each block with a diagram macro: by hand one at a time, or all at once with Render all Mermaid code blocks in our Text Diagrams app.
Why it happens
Markdown import, pasted AI answers and copied README files bring Mermaid in as code blocks. A code block only shows text with colours. Confluence has no Mermaid drawing of its own, so the block stays code until a diagram macro takes over.
Turn every block into a diagram in one step
- Install Mermaid Text Diagrams for Confluence & Jira (free for up to 10 users).
- Open the published page that has the code blocks.
- Open the page menu (... at the top right), then Apps, then Render all Mermaid code blocks.
- Check the list. Blocks marked as Mermaid are ticked. Blocks that only look like Mermaid (no language set) are listed separately and stay unticked until you tick them.
- Press Convert, then Reload. Each block is now an editable diagram in the same place, also inside tables, expands and panels.
Good to know
- Only the page you run it on changes, and only when you press Convert.
- Page history keeps the old version, so you can go back.
- It works on the published page. Publish your draft first.
- You need permission to edit the page.
- Other code blocks (Python, JSON and so on) are never touched.
One block at a time, by hand
Edit the page, copy the text out of the code block, type /text diagram to insert the Text Diagram (Mermaid) macro, paste, save, then delete the old code block. See Mermaid diagram in Confluence.
Bringing in Markdown files with Mermaid? Markdown in Confluence explains the other options.
Last updated 23 November 2026.