[GH-ISSUE #1453] "Lists should be surrounded by blank lines" inside code block #685

Closed
opened 2026-03-03 01:29:05 +03:00 by kerem · 1 comment
Owner

Originally created by @charisk on GitHub (Dec 16, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1453

A "Lists should be surrounded by blank lines" error is raised for the line line 2 (L2) in the following code block, even though it's not raised for a very similar code block further up the file.

L1:   <pre><code class="javascript">(function() {
L2:   	cp.execFileSync('rm',  ['-rf', path.join(__dirname, "temp")]); // GOOD
L3:   	cp.execSync(<strong>'rm -rf ' + path.join(__dirname, "temp")</strong>); // BAD

I would not expect this to trigger an error.

You can see an example of this in https://github.com/github/vscode-codeql/pull/3872 where CI is failing when running markdown lint on this file, specifically on this line.

This has started happening with v0.15.0.

Originally created by @charisk on GitHub (Dec 16, 2024). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1453 A "Lists should be surrounded by blank lines" error is raised for the line line 2 (L2) in the following code block, even though it's not raised for a very similar code block further up the file. ``` L1: <pre><code class="javascript">(function() { L2: cp.execFileSync('rm', ['-rf', path.join(__dirname, "temp")]); // GOOD L3: cp.execSync(<strong>'rm -rf ' + path.join(__dirname, "temp")</strong>); // BAD ``` I would not expect this to trigger an error. You can see an example of this in https://github.com/github/vscode-codeql/pull/3872 where CI is failing when running markdown lint on [this file](https://github.com/github/vscode-codeql/blob/dependabot/npm_and_yarn/extensions/ql-vscode/markdownlint-cli2-0.16.0/extensions/ql-vscode/test/unit-tests/data/markdown-generation/interpreted-results/path-problem/expected/result-1-github-codeql.md), specifically on [this line](https://github.com/github/vscode-codeql/blob/3febb25e447019749f78f5bcdcdb450a29e52029/extensions/ql-vscode/test/unit-tests/data/markdown-generation/interpreted-results/path-problem/expected/result-1-github-codeql.md?plain=1#L95). This has started happening with v0.15.0.
kerem 2026-03-03 01:29:05 +03:00
Author
Owner

@DavidAnson commented on GitHub (Dec 16, 2024):

I can't tell what's going on from my phone, but here's a minimal repro: https://dlaa.me/markdownlint/#%25m%23%20Heading%0A%0A1.%20Item%0A%20%20%20%3Cpre%3E%0A%20%20%20%5B()%5D%0A%20%20%20%3C%2Fpre%3E%0A%0A%3C!--%20markdownlint-disable-file%20MD033%20--%3E%0A

I'll have a look soon, thanks!

<!-- gh-comment-id:2546977029 --> @DavidAnson commented on GitHub (Dec 16, 2024): I can't tell what's going on from my phone, but here's a minimal repro: https://dlaa.me/markdownlint/#%25m%23%20Heading%0A%0A1.%20Item%0A%20%20%20%3Cpre%3E%0A%20%20%20%5B()%5D%0A%20%20%20%3C%2Fpre%3E%0A%0A%3C!--%20markdownlint-disable-file%20MD033%20--%3E%0A I'll have a look soon, thanks!
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#685
No description provided.