Fix scoped label markdown padding
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 |
---|---|
![]() |
![]() |
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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