[GH-ISSUE #918] New rule to enforce the type of reference link to use #2401

Closed
opened 2026-03-07 20:07:26 +03:00 by kerem · 0 comments
Owner

Originally created by @waldyrious on GitHub (Jul 23, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/918

Commonmark defines three types of reference links:

All of these refer to a link defined elsewhere as [foo]: https://example.com.

There's currently a PR (#845) implementing a rule to select which style of link to use: inline, reference, or consistent. To avoid overloading that rule, and following the recommendation here, I'm opening this issue to request a separate rule specifically for reference links.

I propose the values to be either consistent or an array of the allowable types of reference links (full, collapsed, shortcut).

Originally created by @waldyrious on GitHub (Jul 23, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/918 Commonmark defines [three types of reference links](https://spec.commonmark.org/0.30/#reference-link): - [full](https://spec.commonmark.org/0.30/#full-reference-link), e.g. `[bar][foo]` - [collapsed](https://spec.commonmark.org/0.30/#collapsed-reference-link), e.g. `[foo][]` - [shortcut](https://spec.commonmark.org/0.30/#shortcut-reference-link) , e.g. `[foo]` All of these refer to a link defined elsewhere as `[foo]: https://example.com`. There's currently a PR (#845) implementing a rule to select which style of link to use: inline, reference, or consistent. To avoid overloading that rule, and following the recommendation [here](https://github.com/DavidAnson/markdownlint/issues/456#issuecomment-1646635344), I'm opening this issue to request a separate rule specifically for reference links. I propose the values to be either `consistent` or an array of the allowable types of reference links (`full`, `collapsed`, `shortcut`).
kerem 2026-03-07 20:07:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#2401
No description provided.