Skip to content

Instantly share code, notes, and snippets.

@abalter
Last active December 1, 2016 17:57
Show Gist options
  • Save abalter/668064834481c8560ddecbd4344f9f03 to your computer and use it in GitHub Desktop.
Save abalter/668064834481c8560ddecbd4344f9f03 to your computer and use it in GitHub Desktop.
pandoc-markdown-linebreaks

I'm starting out with a file like this:

This is a 
sentence broken
over many lines
without double spaces at 
the ends of line. It
renders as a single 
paragraph.

Then I run

pandoc -f markdown_github -t html -o markdown-linebreaks.html markdown-linebreaks.md

The resulting file is:

<p>This is a<br />
sentence broken<br />
over many lines<br />
without double spaces at<br />
the ends of line. It<br />
renders as a single<br />
paragraph.</p>

However, github runs the lines together, as html does, as long as none ends with two spaces.

This is a sentence broken over many lines without double spaces at the ends of line. It renders as a single paragraph.

pandoc -f markdown_github -t html -o markdown-linebreaks.html markdown-linebreaks.md
<p>This is a<br />
sentence broken<br />
over many lines<br />
without double spaces at<br />
the ends of line. It<br />
renders as a single<br />
paragraph.</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment