Skip to content

Fix scoped label markdown padding

Coung Ngo requested to merge cngo-fix-scoped-label-markdown-padding into master

What does this MR do?

This MR fixes scoped label markdown padding where old markdown uses labels with the old GlLabel structure so the padding is off.

Background

The markdown in the description and comment textareas in issues is saved in the backend, including the HTML structure of any labels in the markdown.

The HTML structure of scoped labels was saved as the following:

span.gl-label
  a.gl-link
    span.gl-label-text
    span.gl-label-text

However, the GlLabel component was recently updated to add an x button (gitlab-ui!1730 (merged)) and the structure of the HTML was slightly modified to accommodate this new x button so the structure became:

span.gl-label
  a.gl-link
    span.gl-label-text
    span.gl-label-text-scoped
  button.gl-label-close

This caused the padding of backend generated scoped labels to be a bit off, which was fixed in !44044 (merged), and now the padding of scoped labels in old saved markdown needs to be fixed too. An example of old markdown with off-padding scoped labels can be seen in #12345 (closed).

To see locally, go to an issue that had scoped labels added/removed before !44044 (merged) was merged (Oct 1) where you will see the scoped labels with off-padding in the description or issue notes history.

Screenshots

before after
Screenshot_2020-10-14_at_1.34.22_pm Screenshot_2020-10-14_at_1.34.51_pm

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Coung Ngo

Merge request reports