Enable break_on_newline extension by default for Markdown#1628
Open
Enable break_on_newline extension by default for Markdown#1628
Conversation
Enable the existing break_on_newline extension in DEFAULT_EXTENSIONS so the Markdown parser converts soft line breaks to HardBreak objects. This produces visible <br> line breaks in HTML output, matching GFM rendering. The conversion happens in the Markdown parser's paragraph() method, which is the proper place for Markdown-specific behavior. The generic accept_paragraph in ToHtml is unchanged and has no Markdown-specific logic. Also remove the CJK-aware newline-to-space gsub from accept_paragraph that is no longer needed. The RDoc markup parser already handles newline joining at parse time in build_paragraph.
Collaborator
|
🚀 Preview deployment available at: https://b6667172.rdoc-6cd.pages.dev (commit: 2482465) |
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.
Summary
break_on_newlineextension inDEFAULT_EXTENSIONSso the Markdown parser converts soft line breaks toHardBreakobjects at parse time<br>line breaks in HTML output, matching GFM rendering where> Foo\nbarshows "Foo" and "bar" on separate linesparagraph()method, which is the proper place for Markdown-specific behavior — no changes to the genericaccept_paragraphinToHtmlaccept_paragraphthat is no longer needed (the RDoc markup parser already handles newline joining at parse time inbuild_paragraph)Ref: #1550 (comment)