khajavi / pandoc

Automatically exported from code.google.com/p/pandoc
GNU General Public License v2.0
0 stars 0 forks source link

excessive newlines in markdown output #232

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. echo "Hello World" | pandoc -w markdown 

What is the expected output? What do you see instead?

I expect "Hello World\n", but get "Hello World\n\n\n\n".

What version of the product are you using? On what operating system?

* pandoc 1.5.1 with citeproc and syntax highlighting on debian unstable.
* pandoc 1.3-1+b1 debian package

Original issue reported on code.google.com by xabb...@gmail.com on 4 Apr 2010 at 11:53

GoogleCodeExporter commented 9 years ago
The attached patch fixes this for me.
Should I try to avid the dependency on Safe?
Do you prefer merge requests on github?

Original comment by xabb...@gmail.com on 5 Apr 2010 at 1:13

Attachments:

GoogleCodeExporter commented 9 years ago
The new patch adapts the tests too and wraps the long line in Markdown.hs

Original comment by xabb...@gmail.com on 5 Apr 2010 at 9:44

Attachments:

GoogleCodeExporter commented 9 years ago
There are no doubt other excess newlines in markdown output, other than at the 
end.

A cleaner way of doing this would be to use the technique I used in the ConTeXt 
writer. The rendered form of 
each block is wrapped in a BlockWrapper, either Reg or Pad. When these are 
concatenated together, the writer 
ensures that each element wrapped in Pad has exactly one blank line on both 
sides. Ultimately it would be good 
to extend this approach to the markdown and RST writers as well.

Original comment by fiddloso...@gmail.com on 10 Apr 2010 at 7:11

GoogleCodeExporter commented 9 years ago
Fixed in feb70b6e93151682d0560ea30318d5c23ecae8e9
(I've made the final spacing more consistent in all of the writers.)

Original comment by fiddloso...@gmail.com on 20 Jul 2010 at 7:49

GoogleCodeExporter commented 9 years ago
I've just seen this. Thanks for the fix.

Original comment by xabb...@gmail.com on 11 Oct 2010 at 9:11