# Improve numbered lists

**URL:** https://meta.discourse.org/t/improve-numbered-lists/11951
**Category:** Feature
**Tags:** markdown-it-review
**Created:** [January 14, 2014, 10:41am UTC](https://meta.discourse.org/t/improve-numbered-lists/11951 "2014-01-14T10:41:08Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![probus](https://avatars.discourse-cdn.com/v4/letter/p/67e7ee/32.png) [@probus](https://meta.discourse.org/u/probus)
#### Post date: [January 14, 2014, 10:41am UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/1 "2014-01-14T10:41:08Z")

</div>

We’re struggling a bit with the parser and automatic formatting of posts. In particular, numbered lists. There are a couple of ways in which they drive our posters mad:

- You can’t start a list from any other number than one, or have the  
list count down
- You can’t skip numbers or have the same number for  
items
- If you start a paragraph with a number, it get’s interpreted as a list even if it doesn’t have any other numbered items below it. This might not be a big problem when writing in English, but in my language that’s how you write ordinal numbers (1st, 2nd etc). Imagine starting your sentence with “3rd time it happened..” and the forum changing it into “1st time it happened..”

As an example  
**[Gibson.com](http://Gibson.com) Top 50 Guitarists of All Time – 50 to 41**

```
49. (tie) Ritchie Blackmore (Deep Purple, Rainbow)
49. (tie) Kurt Cobain (Nirvana)
47. (tie) Robert Fripp (King Crimson)
47. (tie) Andrés Segovia
42. (tie) Hubert Sumlin (Howlin’ Wolf, Muddy Waters)
42. (tie) Clarence White (The Kentucky Colonels, The Byrds)
42. (tie) Rory Gallagher (Taste, solo)
42. (tie) John Frusciante (Red Hot Chili Peppers)
42. (tie) Richard Thompson
41. David Gilmour (Pink Floyd)

```

turns out like this:

1. (tie) Ritchie Blackmore (Deep Purple, Rainbow)
2. (tie) Kurt Cobain (Nirvana)
3. (tie) Robert Fripp (King Crimson)
4. (tie) Andrés Segovia
5. (tie) Hubert Sumlin (Howlin’ Wolf, Muddy Waters)
6. (tie) Clarence White (The Kentucky Colonels, The Byrds)
7. (tie) Rory Gallagher (Taste, solo)
8. (tie) John Frusciante (Red Hot Chili Peppers)
9. (tie) Richard Thompson
10. David Gilmour (Pink Floyd)

Of course, one can use pre formatted text (as we do now), but it’s not ideal or intuitive. Is there any way to improve or configure this behaviour?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 14, 2014, 12:04pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/2 "2014-01-14T12:04:42Z")

</div>

[Pandoc](http://johnmacfarlane.net/pandoc/try/?text=2.%20hello%0A3.%20world&from=markdown&to=html) has an extension to support specifying of the starting number:

 ![](https://global.discourse-cdn.com/meta/original/2X/7/7677dc25dac37770fc9efb570a610e76c5765ac3.png) 

It is a clear diversion and violation of the markdown spec.

We would be open to adding this functionality (optional - default off) to our markdown parser if contributed via the community. Would probably have to be upstreamed.

The `<ol>` tag does not support arbitrarily numbered lists, so if you were to allow “any order” we would have to construct a special div.

Our markdown parser is actually quite flexible, its possibly it could be hacked to support “floating” numbers but it would mean your forum would work differently to all other Discourse forums out there.

I agree that list support is not markdowns shining moment, and the spec has not moved in like forever.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 14, 2014, 6:08pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/3 "2014-01-14T18:08:26Z")

</div>

1. pears
2. apples

Using the html tags seems to work OK?

```
<ol start=4/><li>pears</li><li>apples</li></ol>

```

---

<div class="post-metadata">

### Author: ![mattengi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattengi/32/122153_2.png) [@mattengi](https://meta.discourse.org/u/mattengi)
#### Post date: [January 14, 2014, 6:40pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/4 "2014-01-14T18:40:22Z")

</div>

How about use ``` for special ol block?

```OL-AS-IS  
3. …  
4. …  
49. …  
56. …  
```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 14, 2014, 8:51pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/5 "2014-01-14T20:51:26Z")

</div>

Sure, but its arbitrarily insane that:

```plaintext
3. hello
4. goodbye

```

Produces

1. hello
2. goodbye

I understand that you want

```plaintext
1. bla
2. boo
2. baz

```

To produce

1. bla
2. boo
3. baz

It allows you to easily insert stuff in a list.

But… not allowing you to pick the starting number. **Arbitrarily insane**

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 14, 2014, 8:54pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/6 "2014-01-14T20:54:06Z")

</div>

Yeah, it should “stick” with the number you start at. We talked about that for markdown-next.

However you said

> [@sam](#):
>
> The \<ol\> tag does not support arbitrarily numbered lists

Which isn’t true..

```
<ol start=4/><li>pears</li><li>apples</li></ol>

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 14, 2014, 8:57pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/7 "2014-01-14T20:57:17Z")

</div>

> [@codinghorror](#):
>
> Which isn’t true..

Sorry, I explained that bad.

I meant `ol` does not support a list like this:

```plaintext
1. hello
7. goodbye 
3. farts

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 14, 2014, 9:47pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/8 "2014-01-14T21:47:25Z")

</div>

Hello, goodbye, farts.. this reminds me of every conversation you and I have had.

---

<div class="post-metadata">

### Author: ![Mark\_Elder](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@Mark\_Elder](https://meta.discourse.org/u/Mark_Elder)
#### Post date: [September 22, 2015, 11:35pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/9 "2015-09-22T23:35:36Z")

</div>

I’m gonna necro this thread, since like, it’s not fixed.

I’m also finding that if you add a numbered list, then interrupt it for whatever reason, example:

1. Entry one
2. Entry two
3. Entry three

URL

1. Entry four

etc. the list reverts to 1 after the URL/interruption.

I also found that if you add in a bullet partway down the list, it _turns all the numbers into bullets_.

Pls, discourse gods, use your wand of fixing to resolve this madness.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 22, 2015, 11:40pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/10 "2015-09-22T23:40:58Z")

</div>

Will be fixed when we upgrade to [https://markdown-it.github.io/](https://markdown-it.github.io/) later this year. Feel free to try it out there.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 23, 2015, 1:32am UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/11 "2015-09-23T01:32:33Z")

</div>

Not “fixed” because it works that way in the spec. The behavior listed above is 100% correct per the official spec. We literally had to fork the project and create a new official spec. Takes time.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 26, 2017, 7:45pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/12 "2017-06-26T19:45:32Z")

</div>

1. bugs of beer on the wall

Nintey nine bugs of beer, eat one bug, what do you have?

1. bugs of 🍻 on wall

* * *

```plaintext
99. bugs of beer on the wall 

Nintey nine bugs of beer, eat one bug, what do you have? 

98. bugs of :beers: on wall

```

> [@CommonMark testing started here!](https://meta.discourse.org/t/commonmark-testing-started-here/65121):
>
> Per our [migration plans](https://meta.discourse.org/t/discourse-commonmark-migration-plans-confetti-ball-balloon), I just enabled [markdown.it](https://github.com/markdown-it/markdown-it) at Meta. It is an excellent [CommonMark](http://commonmark.org/) compliant engine. I expect quite a few edges to be found during this period of testing. Do not open bugs about the new Engine, just reply here. I/we will be updating the top post here with the list of issues and striking out stuff as it is fixed. Current known issues (to be fixed)white_check_mark Onebox vanishes after you start typing and works not-super consistently white_check_mark pending…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 26, 2017, 7:45pm UTC](https://meta.discourse.org/t/improve-numbered-lists/11951/13 "2017-06-26T19:45:35Z")

</div>


