demydd / pandoc

Automatically exported from code.google.com/p/pandoc
0 stars 0 forks source link

Strange <p> tags added in lists #99

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This may be related to issue 98. I am using pandoc 0.46, I think installed
from the web. I don't believe I built the cabal package. I am on Windows XP. 

When converting to HTML, I have foudn that pandoc inserts surprising <p>
tags into bulletted lists. In my case this results in unwanted spacing.
I've attached a source file and the result.

Original issue reported on code.google.com by jgbailey@gmail.com on 24 Oct 2008 at 6:15

Attachments:

GoogleCodeExporter commented 8 years ago
The markdown documentation 
(http://daringfireball.net/projects/markdown/syntax#list)
says: "If list items are separated by blank lines, Markdown will wrap the items 
in
<p> tags in the HTML output."

But that leaves a lot of ambiguity about what to do when some of the items have 
blank
lines and others don't.  Pandoc follows a simple rule (see
http://johnmacfarlane.net/pandoc/README.html#nested-lists), which diverges from
Markdown.pl on some edge cases.  Perhaps a better rule could be used, and I am 
open
to suggestions.

Your case gives me one idea: pandoc could be smarter about when to treat the 
blank
space after the LAST list item as indicating a paragraph.  Right now it treats 
this
as a paragraph if it is not the case that all the other list items are "Plain"
(non-paragraph).  But perhaps pandoc should only pay attention to the last 
block in
each list item.  I think that would give nicer results for your cases, but you'd
still get a paragraph before the code block.

Original comment by fiddloso...@gmail.com on 24 Oct 2008 at 9:14

GoogleCodeExporter commented 8 years ago
I think a paragraph around the code block is fine. It's the extra space around 
single
sentences in a bullet that I don't like. Still, it may just be a limitation of 
the
syntax. Generally pandoc does what I need.

Original comment by jgbailey@gmail.com on 24 Oct 2008 at 10:22

GoogleCodeExporter commented 8 years ago
I improved the heuristic for dealing with the final block in a list in r1470.
This helps with the final item in your first case.  I'll close this issue now,
because I can't think of a way to do better that will be relatively simple and
work in general (without mind reading).

Original comment by fiddloso...@gmail.com on 25 Oct 2008 at 10:10