2022-10-29 23:21:45 -07:00
|
|
|
This rule is triggered when lists (of any kind) are either not preceded or not
|
|
|
|
followed by a blank line:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
Some text
|
2023-09-14 20:59:24 -07:00
|
|
|
* List item
|
|
|
|
* List item
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2023-09-14 20:59:24 -07:00
|
|
|
1. List item
|
|
|
|
2. List item
|
|
|
|
***
|
2022-10-29 23:21:45 -07:00
|
|
|
```
|
|
|
|
|
2023-09-14 20:59:24 -07:00
|
|
|
In the first case above, text immediately precedes the unordered list. In the
|
|
|
|
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):
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
```markdown
|
|
|
|
Some text
|
|
|
|
|
2023-09-14 20:59:24 -07:00
|
|
|
* List item
|
|
|
|
* List item
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2023-09-14 20:59:24 -07:00
|
|
|
1. List item
|
|
|
|
2. List item
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2023-09-14 20:59:24 -07:00
|
|
|
***
|
|
|
|
```
|
|
|
|
|
|
|
|
Note that the following case is **not** a violation of this rule:
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
1. List item
|
|
|
|
More item 1
|
|
|
|
2. List item
|
|
|
|
More item 2
|
2022-10-29 23:21:45 -07:00
|
|
|
```
|
|
|
|
|
2023-09-14 20:59:24 -07:00
|
|
|
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
|