Repository navigation
Keep the container prefix on every line of an HTML block when re-rendering Markdown - #303
Merged
frostming merged 1 commit intoNov 9, 2026
Conversation
frostming
approved these changes
Nov 9, 2026
|
🛡️ 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. |
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.
MarkdownRendererputs the quote marker or list indentation only on the first line of an HTML block. The other lines fall out of the container, so the re-rendered Markdown gives different HTML:Here only
<details>stays in the block quote. The same happens to a<div>or<table>in a list item and to a multi-line comment in a quote.render_html_block()now prefixes every line likerender_code_block()does, with an empty line getting the prefix without trailing spaces, as in #302. It also drops the block's trailing newline before splitting, likerender_code_block(), so the block no longer ends with an extra blank line.Added
test_markdown_renderer_html_block_in_containerwith five cases; they fail on master. Across the CommonMark spec examples, the number whose re-rendered Markdown gives different HTML goes from 29 to 27.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