mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 01:05:55 +03:00
[GH-ISSUE #1629] MD053 unexpectedly triggers on footnote syntax where base word contains : #724
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#724
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 @serriere on GitHub (Jun 5, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1629
What did you do?
Ran
markdownlint-cli2against the following file using the footnote syntax (which I think is supported based on the test files in this repository).What did you expect to happen?
I think this syntax should pass the MD053 rule.
What actually happened?
Raises an MD053 error:
What messages or errors were there?
How can the issue be reproduced?
Running
markdownlint-cli2on the test file above.What version were you using?
markdownlint-cli2 v0.18.1markdownlint v0.38.0What operating system were you using?
macOS Sequoia 15.5Thanks for maintaining this fantastic tooling! Let me know if I can provide any other details.
@DavidAnson commented on GitHub (Jun 5, 2025):
Unrelated question: Did you use a template for the structure above? I've seen a couple of issues lately that look like they were based on a template and I don't know where people are getting that from. Just curious.
@DavidAnson commented on GitHub (Jun 5, 2025):
It's not immediately clear to me why, but the micromark parser extension for footnotes does not recognize your example footnote reference as being valid. Adding a space between the time and the footnote or removing the colon from the time both result in the expected behavior. GitHub allows your syntax as is, so this is a difference in parse behavior. I will open an issue there to see why this is happening.
https://github.com/micromark/micromark-extension-gfm-footnote
@DavidAnson commented on GitHub (Jun 5, 2025):
Nevermind, I just wasn't paying attention. The problem is that the colon character causes footnote syntax to be recognized by the parser as a directive instead.
You can backslash-escape the colon character to get the desired behavior:
https://dlaa.me/markdownlint/#%25m%23%20Footnote%20Test%0A%0ARecognized%201234%5B%5E1%5D.%0A%0ANOT%20recognized%2012%3A34%5B%5E1%5D.%0A%0ARecognized%2012%5C%3A34%5B%5E1%5D.%0A%0A%5B%5E1%5D%3A%20Reference
Reference:
https://github.com/micromark/micromark-extension-directive
@serriere commented on GitHub (Jun 5, 2025):
Thank you for the quick response and the guidance! I ended up using a space as a workaround but good to know that the backslash-escape will also work.
Just turned the "helpful questions" from your issue template into headings 🙂
github.com/DavidAnson/markdownlint@224987d727/.github/ISSUE_TEMPLATE/markdownlint-issue-template.md (L24-L32)@DavidAnson commented on GitHub (Jun 5, 2025):
Haha, okay, look at past me being awesome...