[GH-ISSUE #1393] MD027 - Indented code blocks trigger warning #2522

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

Originally created by @garazdawi on GitHub (Oct 28, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1393

When writing the following:

> This is some code:
>
>     Some indented code
>
>     More code

The MD0027 warning is triggered, which I think is a bug as the above is valid markdown.

This is some code:

Some indented code

More code
Originally created by @garazdawi on GitHub (Oct 28, 2024). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1393 When writing the following: ``` > This is some code: > > Some indented code > > More code ``` The MD0027 warning is triggered, which I think is a bug as the above is valid markdown. > This is some code: > > Some indented code > > More code
kerem 2026-03-07 20:08:33 +03:00
Author
Owner

@garazdawi commented on GitHub (Oct 28, 2024):

Hmm, and just as I hit send I cannot reproduce it any more.... sorry for the noise. I'll reopen if I fugure out what is going on.

<!-- gh-comment-id:2441818547 --> @garazdawi commented on GitHub (Oct 28, 2024): Hmm, and just as I hit send I cannot reproduce it any more.... sorry for the noise. I'll reopen if I fugure out what is going on.
Author
Owner

@garazdawi commented on GitHub (Oct 28, 2024):

Seems like it is github.com/DavidAnson/markdownlint@730ae9a96f (diff-2725cc5ae2) that changed the behaviour of this. Not sure if it is already fixed or not. The reason I got confused was that I was running an earlier version locally and a later version in CI.

<!-- gh-comment-id:2441867187 --> @garazdawi commented on GitHub (Oct 28, 2024): Seems like it is https://github.com/DavidAnson/markdownlint/commit/730ae9a96fb205a99a391fe4a2fc7b9df0a53ad2#diff-2725cc5ae2a7c11d0b5b12c1333d68fe7d2f8d121a1d2f66fb6f1b653146b9b3 that changed the behaviour of this. Not sure if it is already fixed or not. The reason I got confused was that I was running an earlier version locally and a later version in CI.
Author
Owner

@DavidAnson commented on GitHub (Oct 28, 2024):

MD027 does produce a warning for the indented code block in your example: https://dlaa.me/markdownlint/#%25m%23%20Issue%201393%0A%0A%3E%20This%20is%20some%20code%3A%0A%3E%0A%3E%20%20%20%20%20Some%20indented%20code%0A%3E%0A%3E%20%20%20%20%20More%20code%0A

While correct, I think it should probably accommodate indented code blocks inside blockquotes. I'll have a look.

<!-- gh-comment-id:2441959515 --> @DavidAnson commented on GitHub (Oct 28, 2024): MD027 does produce a warning for the indented code block in your example: https://dlaa.me/markdownlint/#%25m%23%20Issue%201393%0A%0A%3E%20This%20is%20some%20code%3A%0A%3E%0A%3E%20%20%20%20%20Some%20indented%20code%0A%3E%0A%3E%20%20%20%20%20More%20code%0A While correct, I think it should probably accommodate indented code blocks inside blockquotes. I'll have a look.
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#2522
No description provided.