[GH-ISSUE #586] Add rule to check relative links #465

Closed
opened 2026-03-03 01:27:09 +03:00 by kerem · 2 comments
Owner

Originally created by @koenigst on GitHub (Sep 23, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/586

Use case

  • Check relative link to files
  • Check anchors in relative linked files (this would be an extension to MD051).

Example

Files:

contributing.md
image.png
readme.md

Content readme.md:

# Heading
![image](image.png)
[link to anchor](contributing.md#Heading)

Details

The logic for discovering relative files could be similar to textlint-rule-no-dead-link.

Originally created by @koenigst on GitHub (Sep 23, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/586 ### Use case * Check relative link to files * Check anchors in relative linked files (this would be an extension to [`MD051`](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md051)). ### Example Files: ``` contributing.md image.png readme.md ``` Content `readme.md`: ``` # Heading ![image](image.png) [link to anchor](contributing.md#Heading) ``` ### Details The logic for discovering relative files could be similar to [textlint-rule-no-dead-link](https://github.com/textlint-rule/textlint-rule-no-dead-link#relative-link-resolution).
kerem 2026-03-03 01:27:09 +03:00
  • closed this issue
  • added the
    new rule
    label
Author
Owner

@vorburger commented on GitHub (Mar 12, 2023):

#121 seems related to / a duplicate of this? (TL;DR https://github.com/Divlo/markdownlint-rule-relative-links is a plugin, and https://github.com/tcort/markdown-link-check/ a separate alternative.)

<!-- gh-comment-id:1465307019 --> @vorburger commented on GitHub (Mar 12, 2023): #121 seems related to / a duplicate of this? (TL;DR https://github.com/Divlo/markdownlint-rule-relative-links is a plugin, and https://github.com/tcort/markdown-link-check/ a separate alternative.)
Author
Owner

@DavidAnson commented on GitHub (Mar 12, 2023):

Agree, I will close this. Please add any missing details to that issue.

<!-- gh-comment-id:1465328977 --> @DavidAnson commented on GitHub (Mar 12, 2023): Agree, I will close this. Please add any missing details to that issue.
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#465
No description provided.