[GH-ISSUE #425] Duplicate link reference definitions are not detected #354

Closed
opened 2026-03-03 01:25:58 +03:00 by kerem · 0 comments
Owner

Originally created by @dirk-seynhaeve on GitHub (Sep 5, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/425

Consider:

[test1][1]
![test2][2]
![test3][3]
[1]: https://example.com
[1]: https://commonmark.org/help/images/favicon.png
[4]: ./images/favicon.png

This will silently lead to problems in the rendered markdown

The correct code of course would be:

[test1][1]
![test2][2]
![test3][3]

[1]: https://example.com
[2]: https://commonmark.org/help/images/favicon.png
[3]: ./images/favicon.png

Although linter can not predict which link should be hooked up with which definition, discrepancies should be flagged:

  • Defined but unused references
  • Used but undefined references
  • Duplicate reference definitions
Originally created by @dirk-seynhaeve on GitHub (Sep 5, 2021). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/425 Consider: ```markdown [test1][1] ![test2][2] ![test3][3] [1]: https://example.com [1]: https://commonmark.org/help/images/favicon.png [4]: ./images/favicon.png ``` This will silently lead to problems in the rendered markdown The correct code of course would be: ```markdown [test1][1] ![test2][2] ![test3][3] [1]: https://example.com [2]: https://commonmark.org/help/images/favicon.png [3]: ./images/favicon.png ``` Although linter can not predict which link should be hooked up with which definition, discrepancies should be flagged: * Defined but unused references * Used but undefined references * Duplicate reference definitions
kerem 2026-03-03 01:25:58 +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#354
No description provided.