GFM is rendered twice on issue page, possibly elsewhere
Summary
GitLab Flavoured Markdown is being evaluated twice when loading an issue page. Possibly affects other pages as well.
This doesn't seem to be creating any visible issues now, but it slows down rendering and might lead to some technical debt problems down the line.
Steps to reproduce
- Put a
console.logor breakpoint in therenderGFMfunction inapp/assets/javascripts/behaviors/markdown/render_gfm.js. - Create an issue with a description.
- The breakpoint gets hit twice.
What is the current bug behavior?
The breakpoint gets hit twice.
What is the expected correct behavior?
The breakpoint gets hit once.
Possible fixes
The lines that trigger a GFM render are:
-
app/assets/javascripts/issue_show/components/description.vuein themounted()method -
app/assets/javascripts/behaviors/markdown/render_gfm.js, at the end, on the$('body')selector.