Repository navigation
🐛 fix(markdown): keep line breaks out of link titles - #1259
Merged
Merged
Conversation
A line break in a title came out raw, and the next line could open a block, such as a quote, ending the paragraph mid-link. A title decodes character references (CommonMark 6.3), so the converter writes line breaks as &tox-dev#10; or &tox-dev#13; and escapes a reference-shaped "&".
gaborbernat
force-pushed
the
fix/markdown-link-title
branch
from
October 9, 2026 01:40
8eee286 to
40da425
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
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.
to_markdowncopied a line break in a link or image title as written.<a href="t" title=" >">x</a>became[x](t "\n>"), and its second line opens a block quote (CommonMark 5.1) that ends the paragraph in the middle of the link. A&that starts a reference stayed bare too, sotitle="a&amp;"read back asa&.A title decodes character references (6.3), so the converter now writes a line break as
or and escapes a reference-shaped&. The first example becomes[x](t " >").markdownify 1.2.3 writes
[x](t "\n>"), and html2text 2025.4.15 writes[x](t "\n\n>")\n\n, a blank line that ends the paragraph inside the title.