Skip to content

Preserve task markers in indented list code - #451

Open
AryanRG wants to merge 1 commit into
executablebooks:masterfrom
AryanRG:fix/task-marker-indented-code
Open

AryanRG wants to merge 1 commit into
executablebooks:masterfrom
AryanRG:fix/task-marker-indented-code

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 17, 2026

Copy link
Copy Markdown

With task lists enabled, checkbox-like text at the start of an indented code block inside a list item is consumed as a task marker. For example, a list item containing literal [x] code loses those characters in both the code token and rendered HTML, and gains a checkbox. GFM task markers apply when the first block is a paragraph, not an indented code block.

Check whether the item is an indented code block after its indentation state is established and before consuming a task marker. This preserves literal code while leaving ordinary task items unchanged. Add boundary regressions and an Unreleased changelog note.

Validation:

  • The proposed regressions: 12 failed on the pristine base; 19 focused cases passed with the fix.
  • Full local suite: 1,051 passed on Python 3.13.
  • Pinned pre-commit hooks, including Ruff and strict mypy, passed.
  • Independent differential checks covered 161,280 parser/render comparisons. Other Python versions and hosted CI are not yet verified.

AI assistance was used to investigate, implement, test, and review this change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant