This is going to sound weird, but I believe the image you posted is absolutely correct. Hear me out:
- In the editor view you have, at the top level, a numbered list with one item numbered ‘1’ - this renders as ‘1’ and no one should doubt this is fine
- At the second level, you have three numbered items, starting with 2 (2,6,10). In the preview, you also have three numbered items, starting with 2 (2,3,4).
- At the third level, under ‘6’/‘3’, you have two numbered items, starting with 7 (7,9). In the preview, you also have three numbered items, starting with 7 (7,8).
The markdown render seems to take the first number you supply in a list and number from there incrementally. If your list was 1,2,3 - it would number 1,2,3. If it was 1,1,1 it would also number 1,2,3. If it was 1,15,42 it would also number 1,2,3.
This is handy for when you rearrange your list and numbers get removed and added - you don’t have to keep track of them in the source, the preview will do it for you.
The issue that’s confusing matters here is that the editor attempts to number the lists automatically as you add new lines, but that number doesn’t reset automatically when you indent the list. So the preview starts a new inner list from the indent at the number that the editor automatically put in there, when you’re expecting it to start from 1.
The issue with my theme is to do with the way I restart the count at a new list in a way that is different than the browser does it by default[^1]. In this instance, my theme looks right, compared to what you’re expecting, but it’s actually wrong because it doesn’t start the list at the number specified.
tl;dr: @Caketray was right and the issue is with the text being inserted and not with the render - my themes are actually wrong.
[^1]: I remove the auto numbers and replace them with my own so I can do fancy colours and shadows and stuff