What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

Why can't I start a numbered list on an arbitrary number?

Example:

  1. Some Point
    • sub point
    • sub point

some explaination pertaining to point 1 above

  1. this should be a 2. not a 1. as I wrote 2. but it changes automatically to 1.

Escaping the dot moves the list too far to the left.

Can we get lists that start on any number?

share|improve this question
6  
Because Markdown sucks when it comes to lists. –  Won't Jun 21 '12 at 15:55

4 Answers 4

up vote 24 down vote accepted

This is a feature of Markdown as far as I know, it's lets you do:

  1. Let
  2. Me
  3. Do
  4. That for you

via:

 5. Let
 4. Me
 3. Do
 2. That for you

(Real case situation: don't you hate it when you have 20 items, and then want to add another one between 2 and 3, and have the rename the whole lot?)

I guess SE could allow the start attribute in the <ol> element to let you do this, but all in all, is there a real life scenario you can provide where you need to do this?


In your provided scenario, what you should really be doing is;

1. Some Point
    - sub point
    - sub point

 Some explaination pertaining to point 1 above

2. this should be a 2. not a 1. as I wrote 2. but it changes automatically to 1.

Note the space before "Some", which provides;

  1. Some Point

    • sub point
    • sub point

    some explaination pertaining to point 1 above

  2. this should be a 2. not a 1. as I wrote 2. but it changes automatically to 1.

share|improve this answer
2  
This is still too difficult to read and doesn't align nicely. I have gone with putting 3x nbsp;s before the number the list should start on and escaping the period. –  darryn.ten Jun 21 '12 at 9:43
6  
Re: “…but all in all, is there a real life scenario you can provide where you need to do this?” Well, I can: in this question, the quoted text should show list number 6 instead of 1; resulting in the fact that the quote is actually incorrect after markdown formats it. There is no way to work around the problem unless you want to ruin the list-style formatting. That certainly fits a RealLife™ scenario showing why this is indeed a frequently met problem. –  e-sushi Nov 30 '13 at 18:39
    
Suppose I want to insert a paragraph between two items? If this paragraph is part of the first item, then it should be indented. Some solutions allow this. However, if the paragraph is a comment about several items preceding it, or an aside about some broader issue related to the list, then it shouldn't be indented, and the item following the paragraph should have the next number after the item that preceded it. What OP is requesting would provide a way to implement that by setting the number of the item after the unindented paragraph. –  Mars Aug 17 at 5:10
    
No, one shouldn't necessarily be doing what Matt suggests. It depends. As I note in my comment on the original question: What if the "some explanation" pertains to several points above, or provides an explanation that introduces the following points, etc. –  Mars Aug 17 at 5:13

Given that

  1. the vast majority of people want this feature,
  2. CommonMark, which we eventually hope to use, supports it, so it would come eventually anyway,
  3. the impact should be minimal since most Markdown lists start with 1.,
  4. even where this isn't the case, nothing will change until the post is edited (we don't automatically re-render questions and answers),

… look, a squirrel!

  1. the start attribute on ol elements has been de-deprecated, so we don't have to mess around with CSS,
  2. and this change was fairly easy to implement in the current Markdown version,

you can now start with numbers other than 1. As I said in my other answer,

The number that starts a numbered list in the Markdown source will also be the starting number in the rendered version. The actual values of subsequent numbers will be irrelevant as always (the rendered version will just increment one-by-one); only the first number counts.

This change is live on all sites.

share|improve this answer
    
FYI, TR/html-markup is obsolete as of 2013, but they stupidly only placed the notice on the front page of that specification. While the start attribute has indeed been reinstated, some other information within that specification may be out of date. –  BoltClock's a Unicorn Sep 9 at 9:58
    
Also, is this in Sta— ahem, Common Markdown? –  BoltClock's a Unicorn Sep 9 at 10:01
    
@BoltClock'saUnicorn See point 2. –  balpha Sep 9 at 10:14
6  
YOU ARE DISCRIMINATING AGAINST MY RIGHT FOR 0-INDEXED LISTS. HELP HELP I AM BEING REPRESSED!! –  badp Sep 9 at 14:31
    
@badp #notalllists –  balpha Sep 9 at 16:16
1  
In just under the wire at 30 min to midnight local time this is the best news I've heard all day (and I say that having seen it first on Twitter which is teaming with product release "news" today). –  Caleb Sep 9 at 20:26
    
And a 1, and a 2, and 1, 2, 3: “♫ ⅰ little, ⅱ little, ⅲ little Indians, ⅳ little, ⅴ little, ⅵ little Indians, ⅶ little, ⅷ little, ⅸ little Indians, ⅹ little Indian boys! ♫” –  tchrist Sep 20 at 0:17

To make lists "pretty", add double line breaks between items. This surrounds every list items with a <p>, making all vertical spacing consistent.

1. Some Point

    - sub point

    - sub point

 some explaination pertaining to point 1 above

2. this should be a 2. not a 1. as I wrote 2. but it changes automatically to 1.

renders as:

  1. Some Point

    • sub point

    • sub point

    some explaination pertaining to point 1 above

  2. this should be a 2. not a 1. as I wrote 2. but it changes automatically to 1.

share|improve this answer
    
I do not see how this answers OP's question… “Can we get lists that start on any number?” –  e-sushi Nov 30 '13 at 18:44
    
@e-sushi: My answer is a response to this comment by the OP. I just couldn't fit it into the comment area... –  Dennis Nov 30 '13 at 19:50
    
Oh, I didn't notice that. Makes sense… thanks for the heads-up! (btw: have a nice weekend.) –  e-sushi Nov 30 '13 at 20:01

Traditionally, these requests have been closed as dupes of Numbering/bullet interpretation bug?, but I'll keep this open since I think it's worth reconsidering. Even John Gruber's original Markdown documentation says

If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future, Markdown may support starting ordered lists at an arbitrary number.

In other words, it wouldn't be a total deviation from the standard, even if the above was never added to the originial implementation.

However, it's still a breaking change to the syntax, so I would like to use this question to have some discussion on this. The change would be as follows:

The number that starts a numbered list in the Markdown source will also be the starting number in the rendered version. The actual values of subsequent numbers will be irrelevant as always (the rendered version will just increment one-by-one); only the first number counts.

Example:

5. five
8. eight
2. two

becomes

5. five
6. eight
7. two

So please chime in if you see any issues with this change. It has my vote, but there a lots of people here who use Markdown, so I may be forgetting possible issues.

share|improve this answer
12  
This would be fantastic –  darryn.ten Jun 21 '12 at 10:22
2  
I think the one in the question is a good reason not to implement this change. The fact Matt's proposal looks wrong is because of a problem with the styles, not in the parsing of Markdown. –  badp Jun 21 '12 at 10:34
    
That makes perfect sense to me. I'd be quite surprised if this ended up breaking a post, but as you said you never know :) –  Tim Post Jun 21 '12 at 10:37
2  
Should be relatively easy to check the existing posts for patterns that would break, shouldn't it? I've been missing that feature for long and would be very happy to see it implemented. –  Tomalak Jun 21 '12 at 10:48
2  
If it breaks stuff why not use a comment-based extension like done for the syntax highlighter: <!-- list-start: 5 --> –  ThiefMaster Jun 21 '12 at 11:17
4  
@ThiefMaster HTML comments for this kind of thing (even for syntax highlighting) are an ugly, undiscoverable hack. But unlike for syntax highlighting, the list start thing actually has an obvious solution, as evidenced by the fact that even the original Markdown doc considers (if not implements) it. –  balpha Jun 21 '12 at 11:50
    
I’d say that it depends how this is implemented in HTML. Via CSS counters? Good. But does that work everywhere? What are the alternatives? –  Konrad Rudolph Jun 21 '12 at 12:33
    
One case I haven't been able to figure out is having an ordered list of code blocks. To get the code to format properly, you have to break the list or MD will assume it's another paragraph. But then you can't actually number it... –  Felipe Apr 22 '13 at 23:58
    
So how do we chime in to support this change? Upvote darryn.ten's comment? Resuming interrupted lists has its uses. I'd also like to start lists at 0 in programming contexts sometimes. (@Felipe This has nothing to do with numbering… A list is a level of nesting, so you need to nest the code block one level further: indent with 8 spaces instead of 4.) –  Gilles Jul 10 at 8:21
2  
This is still needed, the given solution is still ideal, and it still ought to be an easy fix. Please? –  minitech Jul 12 at 20:03
    
This proposal would provide a solution for the situation I describe in my comment on the original question. –  Mars Aug 17 at 5:12
    
Any news on this? –  Stijn Aug 19 at 12:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .