mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add note about blocks and list indentation to MD029/ol-prefix.
This commit is contained in:
parent
d171b6c6b7
commit
0f73f06232
1 changed files with 24 additions and 0 deletions
24
doc/Rules.md
24
doc/Rules.md
|
@ -992,6 +992,30 @@ This rule supports 0-prefixing ordered list items for uniform indentation:
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: This rule will report violations for cases like the following where an improperly-indented code block (or similar) appears between two list items and "breaks" the list in two:
|
||||||
|
|
||||||
|
~~~markdown
|
||||||
|
1. First list
|
||||||
|
|
||||||
|
```text
|
||||||
|
Code block
|
||||||
|
```
|
||||||
|
|
||||||
|
1. Second list
|
||||||
|
~~~
|
||||||
|
|
||||||
|
The fix is to indent the code block so it becomes part of the preceding list item as intended:
|
||||||
|
|
||||||
|
~~~markdown
|
||||||
|
1. First list
|
||||||
|
|
||||||
|
```text
|
||||||
|
Code block
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Still first list
|
||||||
|
~~~
|
||||||
|
|
||||||
Rationale: Consistent formatting makes it easier to understand a document.
|
Rationale: Consistent formatting makes it easier to understand a document.
|
||||||
|
|
||||||
<a name="md030"></a>
|
<a name="md030"></a>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue