Skip to content

fix(stripComments): not escape checkbox#1357

Closed
eaglethrost wants to merge 2 commits intonextfrom
dimas/CX-2811-strip-comments-checklist-bug
Closed

fix(stripComments): not escape checkbox#1357
eaglethrost wants to merge 2 commits intonextfrom
dimas/CX-2811-strip-comments-checklist-bug

Conversation

@eaglethrost
Copy link
Contributor

@eaglethrost eaglethrost commented Feb 24, 2026

PR App Fix CX-2979

🧰 Changes

Checkboxes are currently not being rendered in non-admin view when sanitise comment is on (in all legacy, mdx, mdxish projects). The root cause of this is because of the remarkParse and remarkStringify plugins in the stripComments pipeline which escapes [ ].

The fix is to utilise the micromark plugin mdast-util-gfm-task-list-item that specifically parses checkboxes correctly in the pipeline. This should be safe to do as it's just an extension of the pipeline. The reasons of why this is not an issue in mdx or mdxish is because it uses remark-gfm which already included that plugin.

Before After
Screenshot 2026-02-25 at 3 21 05 pm Screenshot 2026-02-25 at 3 27 31 pm

🧬 QA & Testing

  1. Create a document with some checkboxes, such as:
- [ ] empty checkbox
- [x] ticked checkbox
- \[ ] escaped bracket should still not be converted to checkbox
- [ afa ] should not be converted to checkbox
  1. In the markdown playground, test the input with strip comments option on, and test with legacy, mdx, and mdxish rendering engine.
  2. The checkboxes should get rendered and not just be plain [ ]. There should also be no rendering difference in the 3 engines with strip comments on

@eaglethrost eaglethrost marked this pull request as ready for review February 25, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant