Repository navigation
Escape block markers on paragraph continuation lines with the GFM extension too - #316
Merged
frostming merged 1 commit intoNov 11, 2026
Conversation
|
🛡️ Human Attestation required. A human needs to confirm this PR once before it can merge. Attest this PR — sign in with GitHub, pass the challenge, and confirm one of the statements. |
frostming
approved these changes
Nov 11, 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.
#310 escapes a block marker at the start of a paragraph continuation line in
MarkdownRenderer.render_paragraph(). But the GFM extension overridesrender_paragraph()for the Markdown renderer, to write the checkbox of a task list item, and it renders the children itself, so withextensions=["gfm"]the escaping doesn't happen:The rendering of the paragraph's children, with the escaping, is moved to
MarkdownRenderer._render_paragraph_children(), whichrender_paragraph()and the GFM override both use. The output ofMarkdownRendereritself is unchanged, and the GFM override still writes the checkbox.Added
test_render_paragraph_continuation_block_starttoTestGFMTableLlistElement, with a task list item; its three cases fail on master. Across the GFM spec examples, the number whose re-rendered Markdown gives different HTML with the GFM extension goes from 23 to 18 (examples 19, 40, 57, 214 and 290, the same ones #310 fixed without the extension).pytest tests, black, isort and flake8 pass, and mypy reports the same 5 errors as on master.Used Claude (Opus) to help find and patch this; I reviewed and tested the change