Mermaid not rendered in wiki comment section
Summary
When adding a comment to a GitLab Wiki page that contains a Mermaid diagram (using Markdown), the diagram is not rendered as expected. Instead, the raw Mermaid code is displayed, indicating that Mermaid rendering is not supported or is malfunctioning in Wiki comments.
As you can see in the following screenshot, the mermaid markdown content of the comment should have been rendered, but it is not.
This issue is also related to Mermaid diagram is not rendered if wiki is disp... (#389572 - closed) and Mermaid diagrams are not rendered when adding a... (#386219)
Steps to reproduce
- Go to a Wiki page in a GitLab project.
- Add a comment containing a Mermaid diagram, for example:
```mermaid graph TD; A-->B; A-->C; B-->D; C-->D; ``` - Submit the comment.
Example Project
What is the current bug behavior?
The Mermaid code block is displayed as plain text in the comment. The diagram is not rendered visually.
What is the expected correct behavior?
The Mermaid diagram should be rendered as a diagram in the comment, similar to how it is rendered in issues, merge requests, and Wiki page content.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
- Ensure that the Markdown rendering pipeline for Wiki comments includes Mermaid support, as is done for issues and merge requests.
- Investigate if the frontend or backend is stripping or not processing Mermaid code blocks in Wiki comments.
Patch release information for backports
If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.
Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.
High-severity bug remediation
To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.
