Mermaid chart sandbox doesn't load consistently on Vulnerability Details page
Summary
Occasionally the mermaid diagram rendering doesn't work on content within the Vulnerability Details page. Since the details content is loaded asynchronously, it's possible that the mermaid replacement script has already run on the page.
Steps to reproduce
- Create a vulnerability with mermaid markdown in the description (example)
- Reloading the vulnerability details will occasionally leave the code
(note, wrap the below in three backticks)
mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
Example Project
https://gitlab.com/nmccorrison/security-reports-1-21/-/security/vulnerabilities/54614310
What is the current bug behavior?
Mermaid markdown code block remains on the screen
What is the expected correct behavior?
Mermaid diagram is rendered
Relevant logs and/or screenshots
Behavior when diagram isn't rendered:
Video showing rendering process:
Screen_Recording_2022-08-17_at_9.57.11_AM
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)