[GH-ISSUE #226] MD029/ol-prefix: Ordered list item prefix [Expected: 1; Actual: 3; Style: 1/1/1]markdownlint(MD029) #193

Closed
opened 2026-03-03 01:24:34 +03:00 by kerem · 5 comments
Owner

Originally created by @xueqing on GitHub (Oct 12, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/226

I try to insert some code between ordered list items. The preview page is normal, but the raw doc reminds me to reset item prefix to 1. And my editor is VSCode 1.38.1.

Example(test.md):

# test order list

1. step 1
2. step 2

```sh
echo "hello"
```

1. step 3

test order list

  1. step 1
  2. step 2
echo "hello"
  1. step 3

image

Originally created by @xueqing on GitHub (Oct 12, 2019). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/226 I try to insert some code between ordered list items. The preview page is normal, but the raw doc reminds me to reset item prefix to 1. And my editor is VSCode 1.38.1. Example(test.md): # test order list 1. step 1 2. step 2 ```sh echo "hello" ``` 1. step 3 # test order list 1. step 1 2. step 2 ```sh echo "hello" ``` 3. step 3 ![image](https://user-images.githubusercontent.com/6188285/66698098-a760af80-ed0d-11e9-8b46-782571a32461.png)
kerem 2026-03-03 01:24:34 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@nschonni commented on GitHub (Oct 12, 2019):

The code fence needs to be indented under the second item, otherwise 2 lists are created and use a start value for the numbering on the second. IMO Markdownlint is correctly flagging this

<!-- gh-comment-id:541341255 --> @nschonni commented on GitHub (Oct 12, 2019): The code fence needs to be indented under the second item, otherwise 2 lists are created and use a `start` value for the numbering on the second. IMO Markdownlint is correctly flagging this
Author
Owner
<!-- gh-comment-id:541342339 --> @DavidAnson commented on GitHub (Oct 12, 2019): @nschonni is right. You can see the two OL groups for your top example here: https://markdown-it.github.io/#md3=%7B%22source%22%3A%22%23%20test%20order%20list%5Cn%5Cn1.%20step%201%5Cn2.%20step%202%5Cn%5Cn%60%60%60sh%5Cnecho%20%5C%22hello%5C%22%5Cn%60%60%60%5Cn%5Cn1.%20step%203%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22src%22%7D%7D
Author
Owner

@xueqing commented on GitHub (Oct 14, 2019):

Thanks for your explanation! It works for me. And you may close the issue right now or should I close it?

<!-- gh-comment-id:541479361 --> @xueqing commented on GitHub (Oct 14, 2019): Thanks for your explanation! It works for me. And you may close the issue right now or should I close it?
Author
Owner

@DavidAnson commented on GitHub (Oct 14, 2019):

I will - thank you!

<!-- gh-comment-id:541489044 --> @DavidAnson commented on GitHub (Oct 14, 2019): I will - thank you!
Author
Owner
<!-- gh-comment-id:2606464261 --> @harapeko commented on GitHub (Jan 22, 2025): https://markdown-it.github.io/#md3=%7B%22source%22%3A%22%23%20test%20order%20list%5Cn%5Cn1.%20step%201%5Cn2.%20step%202%5Cn%5Cn%60%60%60sh%5Cnecho%20%5C%22hello%5C%22%5Cn%60%60%60%5Cn%5Cn1.%20step%203%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22src%22%7D%7D ![Image](https://github.com/user-attachments/assets/d214e547-7767-4a31-9a6b-f0da99765021)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#193
No description provided.