Repository navigation
Keep the paragraphs of a blockquote on separate lines in HTMLToMarkdown - #1408
Merged
davidmezzetti merged 1 commit intoOct 15, 2026
Merged
Conversation
Member
|
Is this same fix as #1409? |
Contributor
Author
|
No, they fix different things. #1409 handles paragraphs wrapped in inline elements like in article/main mode (#1407). This one is about blockquotes: block() used node.text, so became "> Test1Test2". I checked #1409's branch and it still gives "> Test1Test2" there, while this PR gives "> Test1\n> Test2". The two don't overlap and merge cleanly together. |
Member
|
LGTM - Thank you! |
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.
HTMLToMarkdown.block()usednode.text, which joins child paragraphs with nothing between them. With compact HTML, as written by most generators and minifiers,<blockquote><p>First</p><p>Second</p></blockquote>became> FirstSecond, merging the last word of one paragraph into the first word of the next. Pretty-printed HTML only worked because of the newlines between the tags.Each paragraph (or div) inside a blockquote now starts on its own line, so compact and pretty-printed HTML give the same
> First\n> Second. Text before or after a paragraph is kept on its own line too, and blockquotes without paragraphs are unchanged. Added cases totestHTML.