Skip to content

Enable GFM for snippet's blob and desc rendering

Denys Mishunov requested to merge 216381-gfm-rendering-snippet into master

What does this MR do?

  1. Enables GFM for snippet's Description and Blob Content fields when viewing a snippet. This is supposed to solve #214435 (closed) and #216381 (closed)
  2. Moves out Description rendering out of snippet_title component into a separate one
  3. Since GFM functionality is supposed to be re-used, a new mixin app/assets/javascripts/vue_shared/mixins/markdown_field_mixin.js is created. The mixin is immediately used by the before mentioned Description and Blob Content components.

This functionality is still behind the feature flag (:snippets_vue) so no Changelog entry has been provided.

Why not 3 different MRs?

Very good question. However, this is done for efficiency of the process. In the light of the upcoming work of enabling :snippets_vue flag by default, it makes sense to merge related issues that affect the usability of the refactored Snippet view as soon as possible. Splitting this MR into several ones might have unnecessary delay the process.

Testing

To test, one needs to enable the :snippets_vue feature flag in the local GDK.

Screenshots

Before After
Description (using Mermaid diagram as an example) Screenshot_2020-05-04_at_23.14.16 Screenshot_2020-05-04_at_23.11.47
Blob Content (KaTeX) Screenshot_2020-05-04_at_23.14.28 Screenshot_2020-05-04_at_21.02.22
Blob Content (Mermaid diagram) Screenshot_2020-05-04_at_23.14.22 Screenshot_2020-05-04_at_23.13.07

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

References #216381 (closed) #214435 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports