Repository navigation
Keep a multi-line setext heading setext when re-rendering Markdown - #304
Merged
frostming merged 1 commit intoNov 9, 2026
Merged
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 9, 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.
MarkdownRendererrenders every setext heading as an ATX heading. That only works when the heading is on one line; for a heading that spans lines, the lines after the first become a paragraph:With emphasis across the lines (
Foo *bar\nbaz*\n====, spec example 81) the emphasis breaks too.render_setext_heading()now keeps the setext form when the rendered heading contains a line break, with each line and the===/---underline prefixed for quotes and list items. One-line setext headings are still rendered as ATX headings, as before.Added
test_markdown_renderer_multiline_setext_headingwith four cases (plain, emphasis across lines, in a quote, in a list item); they fail on master. Across the CommonMark spec examples, the number whose re-rendered Markdown gives different HTML goes from 27 to 24.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