According to the official Markdown syntax documentation, "List items may
consist of multiple paragraphs. Each subsequent paragraph in a list item
must be intended by either 4 spaces or one tab."
But Markdown.pl (v. 1.0.2b7 & 1.0.1) seems to allow continuation
paragraphs that are indented fewer than 4 spaces. So, for example,
given the following input
---------------------
1. one
continuation
---------------------
Markdown.pl produces:
---------------------
<ol>
<li><p>one</p>
<p>continuation</p></li>
</ol>
---------------------
Is this a bug, or should the documentated syntax be revised? This more
relaxed behavior is nice in some cases, but it seems to cause problems
in others. For example, this ought to be a nested list followed by a
horizontal rule:
---------------------
+ item 1
+ item 2
* * * * *
---------------------
But Markdown.pl produces this bizarre HTML:
---------------------
<ul>
<li><p>item 1</p>
<ul><li><p>item 2</p></li>
<li><ul><li><ul><li><ul><li>*</li></ul></li></ul></li></ul></li></ul></li>
</ul>
---------------------
Best,
John
John MacFarlane wrote:> Is this a bug, or should the documentated syntax be revised? This more > relaxed behavior is nice in some cases, but it seems to cause problems > in others. For example, this ought to be a nested list followed by a > horizontal rule:I say it's a bug, because it leads to problems like the weird lists when you do: 1. blah 9. blah blah 10. blah blah blah This stuff should be consistent, and any paragraph with <4 spaces of indentation should be considered to exit any block elements, while any between 4 and 7 spaces should be considered to continue the block. When it comes to numbered/unnumbered lists, any number from 1-3 spaces should be ignored, whereas 4-7 spaces should indicate one nested level, etc. etc. These should be consistent between block quotes, numbered and unnumbered lists, and any other present or future block elements. And this stuff should be much more clearly explained in the syntax definition on daringfireball.net, along with how implementations should work on the edge cases. Things like this are where having a true grammar really shows its benefits, as the grammar clarifies both for humans and computers exactly how the parsing should proceed. As is, it's hard to tell without actually running some text through markdown.pl what is going to happen with edge cases. -Jacob
Jacob Rus <jrus at hcs.harvard.edu> wrote on 1/7/07 at 5:07 PM:>This stuff should be consistent, and any paragraph with <4 >spaces of indentation should be considered to exit any block >elements, while any between 4 and 7 spaces should be considered >to continue the block.Yes, this is a bug. -J.G.