Repository navigation
🐛 FIX: Render the task list checkbox after any GFM whitespace - #172
Merged
chrisjsewell merged 1 commit intoNov 12, 2026
Conversation
executablebooks#42 made a tab or form feed after [ ] / [x] count as a task list marker, but make_checkbox still only matched a literal space. The marker was stripped and an empty html_inline was inserted, so the checkbox vanished, and with label_after the leftover ' id="task-item-...">' text leaked into the page.
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.
#42 made the marker detection accept any GFM whitespace after
[ ]/[x], so a tab or form feed now counts as a task.make_checkboxstill checksstartswith("[ ] ")andstartswith("[x] ")with a literal space, so neither branch matches. The item gets thetask-list-itemclass,[ ]is stripped, and an emptyhtml_inlinegoes where the checkbox should be.On 0.7.0:
The checkbox is gone, and so is the marker. With
label=True, label_after=Trueit's worse:content[0:-1] + ' id="..."'runs on the empty string, so the raw textid="task-item-…">shows up in the page:starts_with_todo_markdownhas already matched[ ],[x]or[X]plus whitespace by the timemake_checkboxruns, so the fix only looks at the character inside the brackets.The "Tab after" and "Form feed after" fixtures from #42 had recorded the output without the checkbox. They now expect the
<input>like the space case does.test_label_after_is_escapedgains a tab case for each of unchecked and checked.Verified in a
python:3.12container withpip install -e ".[testing]":master: 728 passed, 3 skipped, 1 xfailedmaster'smdit_py_plugins: 4 failed (both fixtures and both newlabel_aftercases)