-
-
Notifications
You must be signed in to change notification settings - Fork 9
Description
A very common pattern we use in these books:
1. Do this thing
```bash
echo "some cmd"
\```(ignore the \, only needed for issue formatting)
This code block should be indented to the same level as the text in the list item. However, the newline before it causes MkDocs to believe that it is completely separate from the list.
This formatting also causes MkDocs' markdown parser to read that as the end of the list, which causes subsequent list items to be reset (for ordered lists, the number resets to 1).
Any occurrences of this pattern should be fixed with:
1. Do this thing
```bash
echo "some cmd"
\```Note that there is no newline between the list text and the start of the code block.
A quick example of this behavior:
The lines without the newline have the code blocks indented correctly. The one that has a newline does not indent the code block and resets the list back to 1.
Note that this does not only apply to code blocks. The same can be said for images or just regular text. Any newline followed by a non-list item causes the list to reset.