numbered list bug in

Jacob Rus jrus at
Fri Jul 21 16:48:53 EDT 2006

John Gruber wrote:

> A. Pagaltzis <pagaltzis at> wrote on 7/13/06 at 5:45 AM:

>> But I don't have documents any that rely on tiny indentation to

>> mark up nested lists. There is nothing in the docs that specifies

>> the behaviour of this case in detail. In fact I was surprised by

>> the actual behaviour.


>> So I would argue that there is room to tweak the indentation

>> rules, but none to tweak the numbering requirements. I would

>> instead suggest that to start a nested list, the marker be

>> required to be indented at least three spaces more than the

>> preceeding item.


> I agree. Why three though? It "feels" like a reasonable number,

> but four spaces is the magic cut-off point in all the other places

> where indentation matters in Markdown.

Instead of basing the amount of indentation on the exact beginning of
the previous item, I would prefer that each tab or 4 spaces correspond
to one level of indentation. Thus

- 0-3 spaces = top level
- 4-7 spaces = 2nd level
- 8-11 spaces = 3rd level, etc.

Then if an item is indented more than this, it is considered a code block.

So this:

1. a list
2. 2nd item
3. third item
4. fourth item
- sublist
- in same sublist
- still on item 4
5. back to top-level

turn into this:

<li>a list</li>
<li>2nd item</li>
<li>third item</li>
<li>fourth item
<li>in same sublist</li>
<li>still on item 4</li>
<li>back to top-level</li>

instead of what we currently get:

<li>a list
<li>2nd item</li>
<li>third item</li>
<li>fourth item</li>
<li>in same sublist</li>
<li>still on item 4</li>
<li>back to top-level</li>

Obviously this is more ragged than we hope real-life lists will be, but
by keeping stops to 4 spaces, I think we most closely stick to John's
official spec, and keep things as unambiguous as possible.

-Jacob Rus

More information about the Markdown-Discuss mailing list