bug: Fix mermaid rendering on wiki notes
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
bug: Fix mermaid rendering on wiki notes
Problem: At the moment, mermaid diagrams are not rendered correctly
in wiki comments.
This is caused because the renderGFM function is not called
when the note is updated.
See #547843 (closed).
Solution: This commit adds a watcher on the note property
to call renderGFM whenever the note is updated.
Changelog: fixed
References
Screenshots or screen recordings
Add text here.
| Before | After |
|---|---|
| Mermaid diagram fails to render properly after editing a wiki note | Mermaid diagram correctly renders after editing, showing the fix in action |
![]() |
![]() |
How to set up and validate locally
- Start your GDK instance:
gdk start - Go to
http://gdk.test:3000/gitlab-org/gitlab-test - Navigate to the Wiki section of the project
- Create a new Wiki page or edit an existing one
- Add a mermaid diagram in the comment section of the given Wiki page. You can use the following syntax example:
```mermaid graph TD A[Start] --> B{Is it working?} B -->|Yes| C[Great!] B -->|No| D[Debug] D --> A ``` - Save the comment and verify that the mermaid diagram renders correctly
- Edit the comment and make a change to the diagram
- Save the changes and verify that the diagram updates and renders correctly without page refresh
You should see the diagram properly rendered after both initial creation and subsequent edits, confirming the fix is working as expected.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
MR Checklist (@gerardo-navarro)
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the style guides -
Conforms to the javascript style guides -
Conforms to the database guides -
Conforms to the merge request performance guidelines
Related to #547843 (closed)
Edited by Gerardo Navarro

