Workaround for github-flavored markdown not ignoring newlines within paragraphs#41
Merged
liran-funaro merged 1 commit intoliran-funaro:mainfrom Oct 16, 2025
Merged
Conversation
…paragraphs I use sphinx-markdown-builder to generate release notes for GitHub releases. Unlike CommonMark, GitHub's flavor of Markdown interprets input like "line1\nline2" as "line1<br/>line2". As a workaround, I could write each paragraph in my *.rst sources in only one line *.rst. But I'm not sure I want to do that; it would be surprising to people who work on the *.rst sources because all other builders (HTML, man, markdown+commonmark) handle this just fine. Add a workaround to produce a faithful version GitHub-flavored markdown by joining all multiline paragraphs into a single line. I'm not aware of significant downsides yet (except that the Markdown is uglier) but I haven't tested beyond my real-world use. To be safe, I put it behind a config option, if only to not muddy the waters as to which dialect of Markdown we are targeting. Might as well make that option open for extensions, because there are quite a few flavors: $ pandoc --list-input-formats | grep mark -i | paste -sd , commonmark,commonmark_x,markdown,markdown_github,markdown_mmd,markdown_phpextra,markdown_strict
Pull Request Test Coverage Report for Build 18552270670Details
💛 - Coveralls |
Author
|
Thanks! I'd appreciate a release so I can use the PyPI package instead of my fork. But no rush. |
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.
I use sphinx-markdown-builder to generate release notes for GitHub
releases.
Unlike CommonMark, GitHub's flavor of Markdown interprets input like
line1\nline2asline1<br/>line2.As a workaround, I could write each paragraph in my *.rst sources in
only one line *.rst. But I'm not sure I want to do that; it would
be surprising to people who work on the *.rst sources because all
other builders (HTML, man, markdown+commonmark) handle this just fine.
Add a workaround to produce a faithful version GitHub-flavored
markdown by joining all multiline paragraphs into a single line.
I'm not aware of significant downsides yet (except that the Markdown
is uglier) but I haven't tested beyond my real-world use.
To be safe, I put it behind a config option, if only to not muddy
the waters as to which dialect of Markdown we are targeting.
Might as well make that option open for extensions, because there
are quite a few flavors: