tl:dr, look at this example.
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:
10. asd
11. asd
1. start at one
---
10. asd
11. asd
3. start at three
Using CommonMark.Net this renders as
<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 as well as the Commonmark js reference i get the following result (which isnt even a nested list):
<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’s approach is more correct as it maintains the existence of the nested list which looks more consistent.
What do others think?