mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #468] Counter-intuitive behavior after enable/disable + bug with ignore next line. #2233
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#2233
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 @adithyabsk on GitHub (Dec 19, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/468
So I just ran into two separate issues. I was trying to disable an error for a really long iframe embed that I am including in my markdown but was running into all sorts of trouble. I think I was dealing with two separate bugs which is what made it all the more confusing
It seems that if you do the following, it re-enables all the previous ignored rules including deprecated rules such as MD002.
If you instead try to use disable next line in the presence of front-matter, the line does not actually get disabled since it is not offset in the code by the length of the front matter. (I put together a pull request for this issue https://github.com/DavidAnson/markdownlint/pull/469)
@nschonni commented on GitHub (Dec 19, 2021):
https://github.com/DavidAnson/markdownlint#configuration explains that you need to
capturefirst if you want to restore the same ruleset@adithyabsk commented on GitHub (Dec 19, 2021):
Ah, you know what. Now that I've spent some time running through the code base re-reading that section makes a lot more sense. Don't think the wording could be made any clearer--I just missed the capture example.
And, yep. The capture/restore pattern seems to work. I promise I did run through the issues before creating this one, and I hope this issue helps someone else who missed that part of the docs.
Thought, it still would be nice to be able to use the one-liner which I was able to reproduce as an error.
@DavidAnson commented on GitHub (Dec 19, 2021):
Glad you got this sorted out! If there's an example of something not working, please show it and I'll have a look.
@DavidAnson commented on GitHub (Dec 19, 2021):
I think that's what you did with #469?
@adithyabsk commented on GitHub (Dec 19, 2021):
Yep, I was just typing out a message, I think there might be a bug with the way that disable line is handled with front matter. The example is in the PR.
@DavidAnson commented on GitHub (Dec 23, 2021):
Closing this, applying the PR in #469.