What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 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
4  
Because Markdown sucks when it comes to lists. –  Won't Jun 21 '12 at 15:55
add comment

3 Answers

up vote 21 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
5  
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
add comment

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
add comment

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
10  
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
3  
@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
1  
This is still needed, the given solution is still ideal, and it still ought to be an easy fix. Please? –  minitech yesterday
add comment

You must log in to answer this question.

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