[GH-ISSUE #1219] markdownlint-disable-next-line should apply to the next non-empty line #644

Closed
opened 2026-03-03 01:28:43 +03:00 by kerem · 2 comments
Owner

Originally created by @RebeccaStevens on GitHub (May 19, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1219

Ideally this should work.

<!-- markdownlint-disable-next-line MD013 -->

Some really looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong line

Additional Context

Prettier will always insert an empty line after comments in markdown.

Originally created by @RebeccaStevens on GitHub (May 19, 2024). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1219 Ideally this should work. ```md <!-- markdownlint-disable-next-line MD013 --> Some really looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong line ``` ### Additional Context Prettier will always insert an empty line after comments in markdown.
kerem 2026-03-03 01:28:43 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (May 19, 2024):

If you ask me, Prettier shouldn't break stuff like this just for fun. The meaning of "next line" is pretty clear in my mind and if we start trying to redefine it to mean "next line with content but hey is white space content well I don't know just take a guess", I think that could get confusing. :)

The example you show is possible today with the following pattern shown in the README:

<!-- markdownlint-capture -->
<!-- markdownlint-disable MD013 -->

looong line

<!-- markdownlint-restore -->

I am not inclined to add more complexity for this scenario as it seems pretty niche.

<!-- gh-comment-id:2119303931 --> @DavidAnson commented on GitHub (May 19, 2024): If you ask me, Prettier shouldn't break stuff like this just for fun. The meaning of "next line" is pretty clear in my mind and if we start trying to redefine it to mean "next line with content but hey is white space content well I don't know just take a guess", I think that could get confusing. :) The example you show is possible today with the following pattern shown in the README: ``` <!-- markdownlint-capture --> <!-- markdownlint-disable MD013 --> looong line <!-- markdownlint-restore --> ``` I am not inclined to add more complexity for this scenario as it seems pretty niche.
Author
Owner

@jkieboom commented on GitHub (Jul 1, 2025):

Problem is that if a rule forces newlines (e.g. around headings), then you can't ignore a rule for that heading. Trying to use markdownlint-disable-line on the same line of the heading makes the fragment rule fail when trying to link to that heading (I guess a separate issue?)

<!-- gh-comment-id:3024300341 --> @jkieboom commented on GitHub (Jul 1, 2025): Problem is that if a rule forces newlines (e.g. around headings), then you can't ignore a rule for that heading. Trying to use markdownlint-disable-line on the same line of the heading makes the fragment rule fail when trying to link to that heading (I guess a separate issue?)
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#644
No description provided.