24

Today, I noticed a user post an answer to a question. The answer started with

According to the standard:

10 [SOME_TEXT]

14 [SOME_TEXT]

I wanted to edit an make it a list. So I tried editing it into

According to the standard:

  1. [SOME_TEXT]

  1. [SOME_TEXT]

but the edited text appears like this:

According to the standard:

  1. [SOME_TEXT]

  2. [SOME_TEXT]

  • Why does StackOverflow override my numbering?
  • Is it possible to override the numbering?
2
  • 8
    The numbering is overridden by the markdown implementation. This post on MSE might be helpful: meta.stackexchange.com/questions/137077/…
    – Lix
    Commented Mar 29, 2015 at 7:43
  • 4
    It would be great if the value attribute of li were supported.
    – Oriol
    Commented Mar 29, 2015 at 11:19

3 Answers 3

20

Unfortunately the default markup doesn't support the value attribute on the li item. I'm not sure why it is not supported but based on the supported HTML, I tested whether the ol element supports the start attribute. It does because it has been explicitly implemented by balpha:

  1. [SOME_TEXT]
  1. [SOME_TEXT]
  2. [SOME_TEXT next ]

Here is the markup of the above result:

<ol start="10">
  <li> [SOME_TEXT] </li>
</ol>
<ol start="14">
  <li> [SOME_TEXT] </li>
  <li> [SOME_TEXT next ] </li>
</ol>

It is not exactly what you wanted to achieve, but closer than this it won't get.

3
14

It is not necessary to use HTML to achieve this. You can simply split your list into multiple lists and still use markdown syntax by inserting an empty HTML comment.

Content:

10. [SOME_TEXT]

<!---->

14. [SOME_TEXT]
15. [SOME_TEXT]

Result:

  1. [SOME_TEXT]
  1. [SOME_TEXT]
  2. [SOME_TEXT]
2
  • 1
    I see this is already what you did in your question. My bad.
    – Artjom B.
    Commented Mar 29, 2015 at 15:39
  • There is a bigger gap between 10. and 14. than the gap between 14. and 15. when this is done. But it is not a problem...
    – Spikatrix
    Commented Mar 31, 2015 at 6:50
14

With backslashes you can avoid the list generation altogether, though you will now have to leave two whitespaces at the end of each line to force a line break.

1\. lol  
2\. pmsl  
4\. rofl  
5\. lmao

1. lol
2. pmsl
4. rofl
5. lmao

2
  • 2
    Backspaces or Backslashes? I assume you meant the latter.
    – ClickRick
    Commented Mar 31, 2015 at 11:00
  • @ClickRick: lol yes Commented Mar 31, 2015 at 12:20

You must log in to answer this question.

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