Closed Skrillx13 closed 1 month ago
This is not an uncommon way to process these lists, though many CommonMark parsers (which this parser is not) will often restart the list with the specified number.
Basically, due to the lack of indentation on the code block, the code block is not part of the previous list item, so a new list is started after the code block. The default list handler doesn't care about specific numbers but starts a new list always with 1.
So, you have two options here.
I agree with @facelessuser. Whenever a non-list item element exists between two list items, that element ends the first list and a new list is started after it. If the element is intended to be part of the list, then it needs to be indented as a child element, which avoids starting a new list. This is user error, the parser is working as intended. I am closing this.
Context
Had an issue, and reported it to Material for MKDocs. Was told it was a Python Markdown issue so I am creating an issue here.
I was using MKDocs, and making a number list. Unsure if this is a Markdown issue or Material MKDocs issue though, but it seems to be on the MKDocs side.
Bug description
When making said number list, I inserted a code block in between the list, so it looks something like this:
However, instead of rendering like the step above, it rendered like this:
As you can see, the order breaks, and it defaults back to 1 when a code block is inserted through it.
Related links
Reporting a bug GitHub Repo Reproduction 9.5.38-zip.zip
Steps to reproduce
mkdocs new .
, andmkdocs
serve, before adding all my configurations. Created a number list as mentioned in the steps above.