on the philosophical aspects of a specification

Waylan Limberg waylan at gmail.com
Wed Mar 5 13:19:34 EST 2008


On Wed, Mar 5, 2008 at 10:53 AM, John Fraser <john at attacklab.net> wrote:

> A list item's parent is the most recent list item whose bullet is

> indented less than its own. If there's no such parent, then the item

> belongs to a root-level list.

>

> http://six.pairlist.net/pipermail/markdown-discuss/2008-March/001076.html

>

> Is there any case where this doesn't do the right thing?

>


Well, there is the issue of code blocks nested inside list items.
Although, I suppose the parser could increment the list level for each
increment in indentation (up to 4 spaces so as not to eat indentation
on nested code blocks). Then document authors would need to be warned
that if they want nested code blocks in their lists, it is
*recommended* that they only indent their lists by 4 space increments
so as not to confuse the parser. However, if you are not nesting code
blocks, any amount of indentation up to four spaces is fine and each
increase in indentation (even of one space) will result in another
level of nesting.

My only other concern is when stepping back out of the nesting.
Suppose we have the following list:

* no spaces - level 1
* 4 spaces - level 2
* 6 spaces - level 3
* 2 spaces - level 1.5 ???

Obviously, that would break. But what's the best way to handle that? I
do *not* think backtracking through the list and reorganizing the list
levels is a reasonable option. Perhaps, that last line should be root
of a *new* list. What do you think?



--
----
Waylan Limberg
waylan at gmail.com


More information about the Markdown-Discuss mailing list