Fix mermaid diagram preview in rich text editor
What does this MR do and why?
Fix mermaid diagram preview in rich text editor
The SandboxedMermaid component was posting a plain string via postMessage, but the iframe receiver destructures event.data expecting { source, proxiedUrls }. This caused source to be undefined, crashing mermaid's render with "Cannot read properties of undefined (reading 'replace')". Align the message format with render_sandboxed_mermaid.js by posting an object with source and proxiedUrls properties.
Changelog: fixed
References
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Go to any editor, e.g. edit a work item description or write a comment
- Click on the '+' and select mermaid diagram. You can use the template
- Click on 'switch to rich text editing'
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #592223 (closed)

