[GH-ISSUE #55] MD009 for list continuation #1892

Closed
opened 2026-03-07 20:02:30 +03:00 by kerem · 4 comments
Owner

Originally created by @CircleCode on GitHub (Apr 7, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/55

when you make a multi paragraphs list, you have to continue indentation on empty lines. In this case, rule MD009 report an error.
To solve this issue, MD009 should not trigger errors for a line with only spaces if

  • previous lines starts by at least the same amount of lines and following line starts by exactly the same amount of spaces
  • or previous lines starts by exactly the same amount of lines and following line starts by at least the same amount of spaces

Example:

-   first paragraph of the item
    
    second paragraph of the same item

(note: although this is not visible, line 2 is exactly 4 paragraphs)

Originally created by @CircleCode on GitHub (Apr 7, 2017). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/55 when you make a multi paragraphs list, you have to continue indentation on empty lines. In this case, rule MD009 report an error. To solve this issue, MD009 should not trigger errors for a line with only spaces if - previous lines starts by at least the same amount of lines and following line starts by exactly the same amount of spaces - or previous lines starts by exactly the same amount of lines and following line starts by at least the same amount of spaces Example: ``` - first paragraph of the item second paragraph of the same item ``` (note: although this is not visible, line 2 is exactly 4 paragraphs)
kerem 2026-03-07 20:02:30 +03:00
Author
Owner

@DavidAnson commented on GitHub (Apr 8, 2017):

I do not think that is the case. Please refer to section 5.2 of the specification, specifically example 217: http://spec.commonmark.org/0.27/#list-items

Blank lines are not required to contain a matching number of spaces. You can verify this in practice using the underlying parser here: https://markdown-it.github.io/

<!-- gh-comment-id:292695265 --> @DavidAnson commented on GitHub (Apr 8, 2017): I do not think that is the case. Please refer to section 5.2 of the specification, specifically example 217: http://spec.commonmark.org/0.27/#list-items Blank lines are not required to contain a matching number of spaces. You can verify this in practice using the underlying parser here: https://markdown-it.github.io/
Author
Owner

@DavidAnson commented on GitHub (Apr 8, 2017):

If we agree on that, I suggest it is preferable to avoid trailing whitespace for such blank lines and that the current behavior of this rule is reasonable.

<!-- gh-comment-id:292695472 --> @DavidAnson commented on GitHub (Apr 8, 2017): If we agree on that, I suggest it is preferable to avoid trailing whitespace for such blank lines and that the current behavior of this rule is reasonable.
Author
Owner

@CircleCode commented on GitHub (Apr 8, 2017):

I agree with the fact that the current behavior is reasonable regarding commonmark.
If your goal is to strictly adhere to commonmark, this issue can be closed.

However, I think a lot of still living implementations require this indentation continuation.
If you don not disagree with the idea of supporting those implementations, but are reluctant to make a lot of work for them (which makes sense), maybe simply adding an option to ignore lines with only spaces for rule MD009 would be acceptable?

In any case, I'll respect your choice.

TBH, I'd love to switch to commonmark, but while there is no extension mechanism, this is too restricting for my needs.

<!-- gh-comment-id:292710614 --> @CircleCode commented on GitHub (Apr 8, 2017): I agree with the fact that the current behavior is reasonable regarding commonmark. If your goal is to strictly adhere to commonmark, this issue can be closed. However, I think a lot of still living implementations require this indentation continuation. If you don not disagree with the idea of supporting those implementations, but are reluctant to make a lot of work for them (which makes sense), maybe simply adding an option to ignore lines with only spaces for rule MD009 would be acceptable? In any case, I'll respect your choice. TBH, I'd love to switch to commonmark, but while there is no extension mechanism, this is too restricting for my needs.
Author
Owner

@DavidAnson commented on GitHub (Apr 8, 2017):

Your option to ignore for blank lines seems like a good compromise, but it may not be all that difficult to implement this according to your original proposal. Thank you for the suggestion and feedback!

<!-- gh-comment-id:292731903 --> @DavidAnson commented on GitHub (Apr 8, 2017): Your option to ignore for blank lines seems like a good compromise, but it may not be all that difficult to implement this according to your original proposal. Thank you for the suggestion and feedback!
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#1892
No description provided.