mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #1219] markdownlint-disable-next-line should apply to the next non-empty line #2491
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2491
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RebeccaStevens on GitHub (May 19, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1219
Ideally this should work.
Additional Context
Prettier will always insert an empty line after comments in markdown.
@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:
I am not inclined to add more complexity for this scenario as it seems pretty niche.
@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?)