mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 09:46:01 +03:00
[GH-ISSUE #915] MD052: Add option to apply to shortcut reference links too #552
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#552
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 @waldyrious on GitHub (Jul 22, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/915
Currently, MD052 has the following caveat:
I'd like to have an option (defaulting to false in light of the caveat above) to make MD052 also apply to shortcut-syntax reference links, so that I could configure it like this:
(This issue stems from a discussion that started here.)
@DavidAnson commented on GitHub (Jul 22, 2023):
This modification would basically assume that every instance of "[whatever]" in a document was intended to be a link rather than text in brackets. I'm not sure that's very common?
@waldyrious commented on GitHub (Jul 22, 2023):
Yeah, I do agree it is likely to catch false positives, hence the suggestion to default to false. My use case is for specific documents, like this changelog, where using the collapsed syntax would be cumbersome given the number of links. So the configuration to enable this would likely not be project-wise, but file-wise using frontmatter, or even section-wise using HTML comments.
@nex3 commented on GitHub (Aug 22, 2023):
I would very much appreciate this. My Markdown corpus universally uses shortcut-style links, because they're strictly shorter than collapsed-style links, but currently we lose all linting for these links (and in practice we relatively frequently forget to add references). I would love a configuration option for MD052 that would catch these issues. (In the rare cases where I need to use square brackets outside of code formatting, I'd prefer to write
\[foo].)@waldyrious commented on GitHub (Sep 10, 2023):
Thank you for implementing this, @DavidAnson! 💯 🙏
@ElCuboNegro commented on GitHub (Jun 13, 2024):
MD052/reference-links-images is a false positive in all the wikilinks cases.