spacing before list continuations

John MacFarlane jgm at berkeley.edu
Sat Jan 6 21:02:59 EST 2007


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



More information about the Markdown-Discuss mailing list