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

  1. Put a console.log or breakpoint in the renderGFM function in app/assets/javascripts/behaviors/markdown/render_gfm.js.
  2. Create an issue with a description.
  3. 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.vue in the mounted() method
  • app/assets/javascripts/behaviors/markdown/render_gfm.js, at the end, on the $('body') selector.
Assignee Loading
Time tracking Loading