[GH-ISSUE #211] Rule MD032 is not correctly checked #2029

Closed
opened 2026-03-07 20:03:51 +03:00 by kerem · 3 comments
Owner

Originally created by @mebeim on GitHub (Aug 5, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/211

Rule MD032 does not seem to be correctly enforced when text is present on a line immediately following a list. See the example below.

File test.md:

# Title

* This is
not okay

File test.js:

const markdownlint = require("markdownlint");

markdownlint({"files": ["test.md"]}, (_, res) => {
    console.log(res);
});

Output:

Results { 'test.md': [] }

Expected output:

// Something like this:
Results {
    'test.md': [
        {
            lineNumber: 4,
            ruleNames: [Array],
            ruleDescription: 'Lists should be surrounded by blank lines',
            // ...
        }
    ]
}

Node version: 12.7.0
npm version: 6.10.2
markdownlint version: 0.16.0

Originally created by @mebeim on GitHub (Aug 5, 2019). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/211 Rule MD032 does not seem to be correctly enforced when text is present on a line immediately *following* a list. See the example below. File `test.md`: # Title * This is not okay File `test.js`: const markdownlint = require("markdownlint"); markdownlint({"files": ["test.md"]}, (_, res) => { console.log(res); }); Output: Results { 'test.md': [] } Expected output: // Something like this: Results { 'test.md': [ { lineNumber: 4, ruleNames: [Array], ruleDescription: 'Lists should be surrounded by blank lines', // ... } ] } --- Node version: 12.7.0 npm version: 6.10.2 `markdownlint` version: 0.16.0
kerem 2026-03-07 20:03:51 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Aug 6, 2019):

Your example is valid syntax for a list with a single item: https://dlaa.me/markdownlint/#%25m%23%20Title%0A%0A*%20This%20is%0Anot%20okay%0A

I believe this is called “lazy continuation” - here it is in the specification: https://spec.commonmark.org/0.29/#lazy-continuation-line

As such, I believe the current behavior is correct.

<!-- gh-comment-id:518445326 --> @DavidAnson commented on GitHub (Aug 6, 2019): Your example is valid syntax for a list with a single item: https://dlaa.me/markdownlint/#%25m%23%20Title%0A%0A*%20This%20is%0Anot%20okay%0A I believe this is called “lazy continuation” - here it is in the specification: https://spec.commonmark.org/0.29/#lazy-continuation-line As such, I believe the current behavior is correct.
Author
Owner

@mebeim commented on GitHub (Aug 6, 2019):

Thanks for the quick response, @DavidAnson. You're right, the spec allows this for list items. I got confused by the last example for MD032 in Rules.md:

Note: List items without hanging indents are a violation of this rule; list items with hanging indents are okay:

* This is
not okay

* This is
  okay

Should this be reworded to be clearer?

<!-- gh-comment-id:518449862 --> @mebeim commented on GitHub (Aug 6, 2019): Thanks for the quick response, @DavidAnson. You're right, the spec allows this for list items. I got confused by the last example for MD032 in `Rules.md`: > Note: **List items without hanging indents are a violation of this rule**; list items with hanging indents are okay: > > * This is > not okay > > * This is > okay Should this be reworded to be clearer?
Author
Owner

@DavidAnson commented on GitHub (Aug 6, 2019):

Ugh, yes! That section came from the original Ruby implementation and seems wrong for CommonMark. I will remove it entirely - or accept a PR that does so.

Sorry about that!

<!-- gh-comment-id:518452868 --> @DavidAnson commented on GitHub (Aug 6, 2019): Ugh, yes! That section came from the original Ruby implementation and seems wrong for CommonMark. I will remove it entirely - or accept a PR that does so. Sorry about that!
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#2029
No description provided.