zopieux / py-gfm

Github-Flavored Markdown for Python-Markdown.
https://pypi.org/project/py-gfm/
BSD 3-Clause "New" or "Revised" License
71 stars 14 forks source link

Hard Line Breaks #15

Closed matthewblain closed 4 years ago

matthewblain commented 5 years ago

Github does not use 'literal line breaks'. It does offer 'hard line breaks', both with the 'two spaces' method and a 'trailing backslash' method.

See spec at: https://github.github.com/gfm/#hard-line-break

When using py-gfm, it turns on 'literal line breaks' (see issue #9) , which makes it look like it almost works--but the trailing backslash appears in the output, because it's actually ignoring/passing through the trailing backslash and paying attention to the literal line break as per https://python-markdown.github.io/extensions/nl2br/

Repro case: Text like this:

This is a paragaph\ With a break in the middle caused by a trailing slash above, not visible in the output.

This is another paragraph
With a break caused by a double-space above.

This is the last paragraph It should have no breaks in it.

I expect github to render this on the issues page as described in the text above; but py-gfm will cause all three paragraphs to have line breaks, with the trailing slash visible.

I don't know if the gfm spec has changed, as other docs suggest the current behavior was once the correct behavior.

Update: I see all three paragraphs have BR in them in the issue viewer. Oddly when rendered in my source repository, the backslash or double space is required.

zopieux commented 4 years ago

I'm not sure I fully understand the issue at hand. Please provide a concrete example of a syntax that results in a discrepancy between py-gfm and GFM and re-open this issue.