fix: place task checkboxes after list loose is finalized - #4046
Merged
UziTech merged 1 commit intoAug 15, 2026
Merged
Conversation
Loose nested task lists could leave checkboxes outside <p> because checkbox placement used list.loose before spacer detection finished. Compute the final loose state first, then place checkboxes. Fixes markedjs#4045
|
@Hashim1999164 is attempting to deploy a commit to the MarkedJS Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
styfle
reviewed
Aug 15, 2026
Comment on lines
+426
to
+429
| const spacers = item.tokens.filter(t => t.type === 'space'); | ||
| const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => this.rules.other.anyLine.test(t.raw)); | ||
|
|
||
| list.loose = hasMultipleLineBreaks; |
Member
There was a problem hiding this comment.
In a follow up, we could change this one be one line without
list.loose = item.tokens.some(t => t.type === 'space' && this.rules.other.anyLine.test(t.raw));Though no need to change here since its just moving existing code
styfle
approved these changes
Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
list.loose(including spacer-based detection) before placing task checkboxes inTokenizer.list().<p>while later items nest correctly.Fixes #4045
Test plan
npm run buildnpm run test:specs(1781 passed, including newlist_loose_nested_tasksand existing task/list fixtures)<p>; tight nested items stay without<p>