Skip to content

Checkbox cannot be checked if preceded by a blockquote

What does this MR do?

We use the CommonMark SOURCEPOS flag to map lines in the source markdown to the rendered HTML. We then use that to determine which checkbox has been clicked and which line of source it belongs to.

However, when using the GitLab specific blockquote syntax,

>>>
some quoted text
>>>

- [ ] one
- [ ] two

the line numbers no longer match. This is because we add > in front of the quoted text, and remove the two marker lines. Which changes the number of lines of source. Since that is what is run through CommonMark, the line numbers are generated against that source, not the original user source. Making the line number incorrect.

This MR replaces those blockquote fences with \n, keeping the line numbering intact.

Does this MR meet the acceptance criteria?

Conformity

Performance 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

Closes #58717 (closed)

Edited by Brett Walker

Merge request reports