Skip to content

fix(stripComments): not escape checkbox#1360

Merged
eaglethrost merged 1 commit intonextfrom
dimas/CX-2811-strip-comments-checklist-support
Feb 25, 2026
Merged

fix(stripComments): not escape checkbox#1360
eaglethrost merged 1 commit intonextfrom
dimas/CX-2811-strip-comments-checklist-support

Conversation

@eaglethrost
Copy link
Copy Markdown
Contributor

@eaglethrost eaglethrost commented Feb 25, 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 use remark plugin remarkGm to parse checkboxes correctly in the pipeline. This should be safe to do as it's just an extension of the pipeline to support GFM syntax, which checkbox is.

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

['unordered list trailing space', '- A <!-- c -->\n- B', undefined, '* A&#x20;\n* B'],
['between list items', '- Item 1\n<!-- c -->\n- Item 2', undefined, '* Item 1\n\n- Item 2'],
['table cells', '| H1 | H2 |\n| :- | :- |\n| <!-- c --> | data |', undefined, '| H1 | H2 |\n| :- | :- |\n| | data |'],
['table cells', '| H1 | H2 |\n| :- | :- |\n| <!-- c --> | data |', undefined, '| H1 | H2 |\n| :- | :--- |\n| | data |'],
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of side effect, but when rendering this the display look exactly the same

Copy link
Copy Markdown
Contributor

@kevinports kevinports left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm 👍

Surprised we didn't run into this sooner with the GFM table rendering, but maybe our customer using this on legacy just doesn't use GFM table syntax anywhere?

@eaglethrost eaglethrost merged commit a4226c2 into next Feb 25, 2026
11 checks passed
@eaglethrost eaglethrost deleted the dimas/CX-2811-strip-comments-checklist-support branch February 25, 2026 23:51
rafegoldberg pushed a commit that referenced this pull request Feb 26, 2026
## Version 13.4.0
### ✨ New & Improved

* **mdxish:** preserve jsx expressions in ast processor ([#1332](#1332)) ([7704aaa](7704aaa))

### 🛠 Fixes & Updates

* focus on code copy button ([#1352](#1352)) ([6853be1](6853be1))
* **stripComments:** not escape checkbox ([#1360](#1360)) ([a4226c2](a4226c2))
* preserve legacy syntax for legacy variables ([#1365](#1365)) ([d735a99](d735a99))

<!--SKIP CI-->
@rafegoldberg
Copy link
Copy Markdown
Contributor

This PR was released!

🚀 Changes included in v13.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants