fix: avoid task checkbox for setext heading text#3960
fix: avoid task checkbox for setext heading text#3960UziTech merged 5 commits intomarkedjs:masterfrom
Conversation
|
@AbdelrahmanHafez is attempting to deploy a commit to the MarkedJS Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Code Review
This pull request modifies the Tokenizer to prevent setext headings within list items from being incorrectly identified as task checkboxes. The logic now ensures that task checkbox processing only occurs if the first token of a list item is of type 'text' or 'paragraph'. Corresponding unit tests have been added to Lexer.test.js and marked.test.js to verify that these headings are rendered correctly without checkbox inputs. I have no feedback to provide.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
UziTech
left a comment
There was a problem hiding this comment.
Thanks for improving marked! 💯
## [18.0.3](v18.0.2...v18.0.3) (2026-05-01) ### Bug Fixes * avoid task checkbox for setext heading text ([#3960](#3960)) ([2608e81](2608e81))
Marked version: 18.0.2
Markdown flavor: GitHub Flavored Markdown
Description
re #3828
Setext headings inside list items that start with
[x]or[ ]were parsed as task list items, so the marker was removed and a disabled checkbox was inserted.Expectation
renders as a list item containing
<h2>[x] title</h2>.Result
Demo
Marked rendered the same input as a checked task list item with a heading.
What was attempted
Only finalize task-list parsing when the preserved checkbox marker belongs to a text-like first child token. Added unit coverage for the rendered HTML and lexer token shape.
Contributor
Committer
In most cases, this should be a different person than the contributor.