# Unclear spec regarding nested ordered lists with start numbers

**URL:** <https://talk.commonmark.org/t/unclear-spec-regarding-nested-ordered-lists-with-start-numbers/2199>\
**Category:** Spec\
**Created:** [August 15, 2016, 1:59am UTC](https://talk.commonmark.org/t/unclear-spec-regarding-nested-ordered-lists-with-start-numbers/2199 "2016-08-15T01:59:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elexisvenator](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/elexisvenator/32/1018_2.png) [@elexisvenator](https://talk.commonmark.org/u/elexisvenator)\
**Post date:** [August 15, 2016, 1:59am UTC](https://talk.commonmark.org/t/unclear-spec-regarding-nested-ordered-lists-with-start-numbers/2199/1 "2016-08-15T01:59:40Z")

</div>

tl:dr, look at [this example](http://spec.commonmark.org/dingus/?text=10.%20asd%0A11.%20asd%0A%20%20%20%201.%20start%20at%20one%0A%0A---%0A%0A10.%20asd%0A11.%20asd%0A%20%20%20%203.%20start%20at%20three%0A%0A).

I was looking into switching between 2 different commonmark-compliant C# libraries when I noticed that the way they treated nested ordered lists differed if i started the nested list with a number that isn’t 1.

Take the following code:

```auto
10. asd
11. asd
    1. start at one

---

10. asd
11. asd
    3. start at three

```

Using [CommonMark.Net](https://github.com/Knagis/CommonMark.NET) this renders as

```auto
<ol start="10">
<li>asd</li>
<li>asd
<ol>
<li>start at one</li>
</ol>
</li>
</ol>
<hr>
<ol start="10">
<li>asd</li>
<li>asd
<ol start="3">
<li>start at three</li>
</ol>
</li>
</ol>

```

However, using [Markdig](https://github.com/lunet-io/markdig) as well as the [Commonmark js reference](http://spec.commonmark.org/dingus/?text=10.%20asd%0A11.%20asd%0A%20%20%20%201.%20start%20at%20one%0A%0A---%0A%0A10.%20asd%0A11.%20asd%0A%20%20%20%203.%20start%20at%20three%0A%0A) i get the following result (which isnt even a nested list):

```auto
<ol start="10">
<li>asd</li>
<li>asd
<ol>
<li>start at one</li>
</ol>
</li>
</ol>
<hr />
<ol start="10">
<li>asd</li>
<li>asd
3. start at three</li>
</ol>

```

I had a look at the latest spec (0.26 at time of writing) and I cannot find anything regarding startnumbers on nested ordered lists, meaning I think there is room for clarification here.

Personally, I think [commonmark.Net](http://commonmark.Net)’s approach is more correct as it maintains the existence of the nested list which looks more consistent.

What do others think?

---

<div class="post-metadata">

**Author:** ![jkdev](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/j/e79b87/32.png) [@jkdev](https://talk.commonmark.org/u/jkdev)\
**Post date:** [August 22, 2016, 2:10pm UTC](https://talk.commonmark.org/t/unclear-spec-regarding-nested-ordered-lists-with-start-numbers/2199/2 "2016-08-22T14:10:12Z")

</div>

> [@elexisvenator](#):
>
> Personally, I think [commonmark.Net](http://commonmark.Net)’s approach is more correct as it maintains the existence of the nested list which looks more consistent.

This makes sense.

interestingly enough, commonmark 0.26.0 and [league/commonmark](https://github.com/thephpleague/commonmark) (PHP) produce substantially different output here. It is league/commonmark that produces similar output to [CommonMark.Net](http://CommonMark.Net), including a sublist starting with 3:

```auto
<ol start="10">
<li>asd</li>
<li>asd
<ol>
<li>start at one</li>
</ol>
</li>
</ol>
<hr>
<ol start="10">
<li>asd</li>
<li>asd
<ol start="3">
<li>start at three</li>
</ol>
</li>
</ol>

```

As for backwards compatibility, most implementations on [BabelMark](http://johnmacfarlane.net/babelmark2/?normalize=1&text=10.+asd%0A11.+asd%0A++++1.+start+at+one%0A%0A---%0A%0A10.+asd%0A11.+asd%0A++++3.+start+at+three%0A%0A) create a sublist that starts with 1. Only commonmark 0.26.0 and markdig don’t produce a sublist at all.

---

<div class="post-metadata">

**Author:** ![jgm](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [September 2, 2016, 9:12am UTC](https://talk.commonmark.org/t/unclear-spec-regarding-nested-ordered-lists-with-start-numbers/2199/3 "2016-09-02T09:12:29Z")

</div>

This divergence is due to a relatively recent change to CommonMark (which I’m still not fully persuaded is the right approach).

The change says that an ordered list can only interrupt a paragraph (i.e. with no preceding blank line) when it starts with `1.`. For motivation and background (as well as some dissent), see [Blank lines before lists, revisited](https://talk.commonmark.org/t/blank-lines-before-lists-revisited/1990/7)
