larstvei / ox-gfm

Github Flavored Markdown Back-End for Org Export Engine
230 stars 44 forks source link

Trim excess newlines inside paragraphs #7

Closed scottoasis closed 8 years ago

scottoasis commented 8 years ago

Github Flavored Markdown recognizes new line character \n is end of a paragraph, thus a markdown snippet like this:

This is a small exporter based on the Markdown exporter
already existing in Org mode. It should support the features listed
here.

The exporter has made it's way into to the contrib section of Org,
and can be found here.

Would be rendered on Github as below:


This is a small exporter based on the Markdown exporter already existing in Org mode. It should support the features listed here.

The exporter has made it's way into to the contrib section of Org, and can be found here.


To keep markdown outputs generated by ox-gfm consistent with Github Flavored Markdown (and thus make them look prettier on Github), I trimmed excess new line character in a paragraph except the last one, thus the markdown output of the same Org-Mode snippet would look like:

This is a small exporter based on the Markdown exporter already existing in Org mode. It should support the features listed here.

The exporter has made it's way into to the contrib section of Org,and can be found here.

And looks perfect on Github:


This is a small exporter based on the Markdown exporter already existing in Org mode. It should support the features listed here.

The exporter has made it's way into to the contrib section of Org,and can be found here.


Thanks. cc @larstvei

larstvei commented 8 years ago

Looks good. Merged!