fix: fall back to default checkbox renderer when extension returns false#4023
Merged
UziTech merged 1 commit intoJul 24, 2026
Conversation
A renderer extension named after a built-in token can return false to fall back to the default renderer. The Parser decides that from a list of built-in token type names, and 'checkbox' was never added to either the block or the inline list when the checkbox token was introduced. The result is that a `checkbox` renderer extension returning false emits nothing instead of falling back, so the checkbox silently disappears from the task item.
|
@sarathfrancis90 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.
|
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.
Markdown flavor: GitHub Flavored Markdown
A renderer extension named after a built-in token can return
falseto fall back to the default renderer — that's the documented contract in USING_PRO, and it works forcode,heading,textand the rest. It doesn't work forcheckbox: the checkbox silently disappears instead.I expected the checked item to fall back to the default
<input checked="" disabled="" type="checkbox">, but it renders as just<li>one</li>. The unchecked item never returnsfalse, and it renders fine, so only the fallback path is broken.Parserdecides whether afalsereturn should fall through to the built-in renderer by testing the token type against a hardcoded list of built-in type names.checkboxwas added to both parse switches in #3755 but never to either list, so the fallback branch is unreachable for it and theret || ''path wins.Added
checkboxto the block and inline lists. Both matter in practice: a tight list puts the checkbox token at block level while a loose list puts it inline, so there's a test for each.Contributor