mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update documentation for MD032/blanks-around-lists to correct an example and discuss lazy continuation lines (fixes #972).
This commit is contained in:
parent
d45d7ef5bb
commit
3e44e43ac4
3 changed files with 93 additions and 42 deletions
|
@ -3,28 +3,45 @@ followed by a blank line:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Some text
|
Some text
|
||||||
* Some
|
* List item
|
||||||
* List
|
* List item
|
||||||
|
|
||||||
1. Some
|
1. List item
|
||||||
2. List
|
2. List item
|
||||||
Some text
|
***
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, ensure that all lists have a blank line both before and after
|
In the first case above, text immediately precedes the unordered list. In the
|
||||||
(except where the block is at the beginning or end of the document):
|
second case above, a thematic break immediately follows the ordered list. To fix
|
||||||
|
violations of this rule, ensure that all lists have a blank line both before and
|
||||||
|
after (except when the list is at the very beginning or end of the document):
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Some text
|
Some text
|
||||||
|
|
||||||
* Some
|
* List item
|
||||||
* List
|
* List item
|
||||||
|
|
||||||
1. Some
|
1. List item
|
||||||
2. List
|
2. List item
|
||||||
|
|
||||||
Some text
|
***
|
||||||
```
|
```
|
||||||
|
|
||||||
Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will
|
Note that the following case is **not** a violation of this rule:
|
||||||
not parse lists that don't have blank lines before and after them.
|
|
||||||
|
```markdown
|
||||||
|
1. List item
|
||||||
|
More item 1
|
||||||
|
2. List item
|
||||||
|
More item 2
|
||||||
|
```
|
||||||
|
|
||||||
|
Although it is not indented, the text "More item 2" is referred to as a
|
||||||
|
[lazy continuation line][lazy-continuation] and considered part of the second
|
||||||
|
list item.
|
||||||
|
|
||||||
|
Rationale: In addition to aesthetic reasons, some parsers, including kramdown,
|
||||||
|
will not parse lists that don't have blank lines before and after them.
|
||||||
|
|
||||||
|
[lazy-continuation]: https://spec.commonmark.org/0.30/#lazy-continuation-line
|
||||||
|
|
45
doc/Rules.md
45
doc/Rules.md
|
@ -1347,31 +1347,48 @@ followed by a blank line:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Some text
|
Some text
|
||||||
* Some
|
* List item
|
||||||
* List
|
* List item
|
||||||
|
|
||||||
1. Some
|
1. List item
|
||||||
2. List
|
2. List item
|
||||||
Some text
|
***
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, ensure that all lists have a blank line both before and after
|
In the first case above, text immediately precedes the unordered list. In the
|
||||||
(except where the block is at the beginning or end of the document):
|
second case above, a thematic break immediately follows the ordered list. To fix
|
||||||
|
violations of this rule, ensure that all lists have a blank line both before and
|
||||||
|
after (except when the list is at the very beginning or end of the document):
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Some text
|
Some text
|
||||||
|
|
||||||
* Some
|
* List item
|
||||||
* List
|
* List item
|
||||||
|
|
||||||
1. Some
|
1. List item
|
||||||
2. List
|
2. List item
|
||||||
|
|
||||||
Some text
|
***
|
||||||
```
|
```
|
||||||
|
|
||||||
Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will
|
Note that the following case is **not** a violation of this rule:
|
||||||
not parse lists that don't have blank lines before and after them.
|
|
||||||
|
```markdown
|
||||||
|
1. List item
|
||||||
|
More item 1
|
||||||
|
2. List item
|
||||||
|
More item 2
|
||||||
|
```
|
||||||
|
|
||||||
|
Although it is not indented, the text "More item 2" is referred to as a
|
||||||
|
[lazy continuation line][lazy-continuation] and considered part of the second
|
||||||
|
list item.
|
||||||
|
|
||||||
|
Rationale: In addition to aesthetic reasons, some parsers, including kramdown,
|
||||||
|
will not parse lists that don't have blank lines before and after them.
|
||||||
|
|
||||||
|
[lazy-continuation]: https://spec.commonmark.org/0.30/#lazy-continuation-line
|
||||||
|
|
||||||
<a name="md033"></a>
|
<a name="md033"></a>
|
||||||
|
|
||||||
|
|
45
doc/md032.md
45
doc/md032.md
|
@ -11,28 +11,45 @@ followed by a blank line:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Some text
|
Some text
|
||||||
* Some
|
* List item
|
||||||
* List
|
* List item
|
||||||
|
|
||||||
1. Some
|
1. List item
|
||||||
2. List
|
2. List item
|
||||||
Some text
|
***
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix this, ensure that all lists have a blank line both before and after
|
In the first case above, text immediately precedes the unordered list. In the
|
||||||
(except where the block is at the beginning or end of the document):
|
second case above, a thematic break immediately follows the ordered list. To fix
|
||||||
|
violations of this rule, ensure that all lists have a blank line both before and
|
||||||
|
after (except when the list is at the very beginning or end of the document):
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
Some text
|
Some text
|
||||||
|
|
||||||
* Some
|
* List item
|
||||||
* List
|
* List item
|
||||||
|
|
||||||
1. Some
|
1. List item
|
||||||
2. List
|
2. List item
|
||||||
|
|
||||||
Some text
|
***
|
||||||
```
|
```
|
||||||
|
|
||||||
Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will
|
Note that the following case is **not** a violation of this rule:
|
||||||
not parse lists that don't have blank lines before and after them.
|
|
||||||
|
```markdown
|
||||||
|
1. List item
|
||||||
|
More item 1
|
||||||
|
2. List item
|
||||||
|
More item 2
|
||||||
|
```
|
||||||
|
|
||||||
|
Although it is not indented, the text "More item 2" is referred to as a
|
||||||
|
[lazy continuation line][lazy-continuation] and considered part of the second
|
||||||
|
list item.
|
||||||
|
|
||||||
|
Rationale: In addition to aesthetic reasons, some parsers, including kramdown,
|
||||||
|
will not parse lists that don't have blank lines before and after them.
|
||||||
|
|
||||||
|
[lazy-continuation]: https://spec.commonmark.org/0.30/#lazy-continuation-line
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue