Repository navigation
fix: recognize task list items when a tab follows the checkbox - #4163
Merged
Merged
Conversation
|
@CyberNativeAI 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.
|
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 2, 2026
## [18.1.3](v18.1.2...v18.1.3) (2026-11-02) ### Bug Fixes * allow trailing tabs after a setext heading underline ([#4152](#4152)) ([1f1b480](1f1b480)) * avoid quadratic scan for unmatched emphasis delimiters ([#4103](#4103)) ([eab1e48](eab1e48)), closes [#4099](#4099) * await promise arrays from walkTokens extensions ([#4153](#4153)) ([c38704c](c38704c)) * **cli:** honor defaults and config when outputting tokens ([#4146](#4146)) ([9470e8f](9470e8f)) * collapse internal whitespace when normalizing link labels ([#4157](#4157)) ([02c73e8](02c73e8)) * do not allow a blank line inside a link reference definition label ([#4165](#4165)) ([f3d21af](f3d21af)) * don't treat an escaped ) or quote as an inline link or title closer ([#4151](#4151)) ([9cb84e0](9cb84e0)) * end a list item before a lazy line after an html block ([#4159](#4159)) ([7ba42f4](7ba42f4)) * end blockquote before a lazy line after a table ([#4161](#4161)) ([e7dcf52](e7dcf52)) * isolate extension names from Object.prototype ([#4177](#4177)) ([5cb03bd](5cb03bd)) * keep a block quote open after a lazy line in a nested block quote ([#4175](#4175)) ([1d7272f](1d7272f)) * only close a code fence with the opening fence character ([#4164](#4164)) ([1d4d8fe](1d4d8fe)) * preserve zero-valued custom renderer results ([#4162](#4162)) ([e43ceef](e43ceef)) * recognize task list items when a tab follows the checkbox ([#4163](#4163)) ([64a299d](64a299d)) * start a GFM www autolink only at a word boundary ([#4166](#4166)) ([84beefb](84beefb)) ### Performance Improvements * fix backtracking in padantic html ([#4173](#4173)) ([2d4a23c](2d4a23c))
2 of 6 tasks
This was referenced Nov 6, 2026
This branch was successfully deployed
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.
Marked version: 18.1.1 (also current master 4b7b5b2)
Markdown flavor: GitHub Flavored Markdown
Description
We did not find an existing issue or pull request for this. With
gfm: true, a task marker followed by a tab is not recognized as a task.Expectation
A list item whose task marker is followed by a tab renders as a task item, the same as when a space follows it:
GitHub renders these as checkboxes. We checked
- [ ]\tfoo,- [x]\tfooand- [X] \titem(space, then tab) through GitHub's Markdown API (POST /markdown,mode: gfm) on 2026-10-24; each one returned an<input type="checkbox">.The GFM spec (0.29, section 5.3) defines the marker as
[, "either a whitespace character or the letter x",], and section 2.1 defines a whitespace character as a space, tab, newline, line tabulation, form feed or carriage return. The spec does not say what has to follow the marker, and none of its examples has a tab after it. So we are relying on GitHub's own rendering here, not on a failing spec example.Result
With
gfm: true, the item stays literal text:The list item token has
task: falseandchecked: undefined. The same happens after[ ]and[X], for space then tab, for tab then space, in ordered lists and in loose lists.What was attempted
other.listIsTask(/^\[[ xX]\] +\S/) andother.listReplaceTask(/^\[[ xX]\] +/) insrc/rules.tsaccept only spaces after]. This PR changes+to[ \t]+in both. Nothing else changes.These keep their current output:
- [x] foo(task),- [x]foo(not a task),- [ ]and- [ ]followed by a tab and nothing else (not a task), andgfm: false(never a task). With the fix, the tab case renders<input ...> foo, the same as the space case does now; GitHub keeps the tab in the item text.Contributor
New spec fixture
test/specs/new/tasklist_tab.md/.html: a tab after[ ]and[x], and a space then a tab after[X]. The.mdcontains literal tab characters.node --test test/run-spec-tests.js test/unit/*.test.js(thetest:specsandtest:unitsuites) afternpm run build:esbuild: without thesrc/rules.tschange onlytasklist_tabfails; with it everything passes.eslint src/rules.tsis clean. We did not runtest:umd,test:cjs,test:typesortest:redos.Committer
In most cases, this should be a different person than the contributor.
Prepared by CyberNative AI LLC, an AI-run company, using AI agents.