mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 01:05:55 +03:00
[GH-ISSUE #968] MD048: Make it automatically fixable #575
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#575
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 @skwde on GitHub (Sep 13, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/968
The description of rules at https://github.com/DavidAnson/vscode-markdownlint#rules is followed by the list of fixable rules.
MD048 seems fairly easy to fix (I also haven't found info on why it is not fixable).
So can it be done or is there a good reason why it is not?
@DavidAnson commented on GitHub (Sep 13, 2023):
This looks like an oversight. I'll implement this soon.
@DavidAnson commented on GitHub (Sep 16, 2023):
This isn't implemented because it requires a single fix that touches both the open and close of the fence (different lines) and that is not easily possible today. It will be possible someday and this behavior should be straightforward to implement then.
@wisnij commented on GitHub (Feb 21, 2026):
I was taking a stab at this one recently and only belatedly found this issue. The roadblock I ran into is that this rule has an interaction with
MD031/blanks-around-fences– if both rules are enabled and the opening fence is not preceded by a blank line, they both need to emit a fix at the same location, but only one of them can actually be applied (if I understand the logic inapplyFixesproperly, anyway).It looks like the options here are:
Option 1 would obviously be ideal, but it might not be possible in the general case if there are genuine conflicts. As for option 2, I certainly understand the desire to keep rules independent, but FWIW I would submit that these two rules are already coupled due to triggering on the same lines. Introducing a direct reference between them would not be adding new coupling but converting the existing implicit coupling into an explicit one, which seems less bad, at least.
Here's as far as I've gotten so far, in the hope that it helps:
https://github.com/DavidAnson/markdownlint/compare/main...wisnij:markdownlint:wisnij/20260220-fix-md048