[GH-ISSUE #68] Add rule(s) to enforce certain link rules #55

Open
opened 2026-03-03 01:23:22 +03:00 by kerem · 3 comments
Owner

Originally created by @braebot on GitHub (Jul 22, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/68

Add rules to detect and error when found:

  1. No http links,
  2. No links include text from a set of given regexes,
  3. No relative links, such as ../path, path. Only allow absolute links, such as /path.

Note: this is similar to those that would be found when crawling a site. However, it is best when caught earlier in the process with markdownlint.

Originally created by @braebot on GitHub (Jul 22, 2017). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/68 Add rules to detect and error when found: 1. No `http` links, 2. No links include text from a set of given regexes, 3. No relative links, such as `../path`, `path`. Only allow absolute links, such as `/path`. Note: this is similar to those that would be found when crawling a site. However, it is best when caught earlier in the process with markdownlint.
Author
Owner

@DavidAnson commented on GitHub (Jul 22, 2017):

Based on your scenarios, a single rule that runs a user-configurable RegExp against the link destination seems sufficient.

<!-- gh-comment-id:317156077 --> @DavidAnson commented on GitHub (Jul 22, 2017): Based on your scenarios, a single rule that runs a user-configurable RegExp against the link destination seems sufficient.
Author
Owner

@braebot commented on GitHub (Jul 22, 2017):

Yes, that would be sufficient!

<!-- gh-comment-id:317164058 --> @braebot commented on GitHub (Jul 22, 2017): Yes, that would be sufficient!
Author
Owner

@sanmai-NL commented on GitHub (Nov 20, 2020):

Another use case: https://github.com/webhintio/hint/issues/4137.

<!-- gh-comment-id:731095842 --> @sanmai-NL commented on GitHub (Nov 20, 2020): Another use case: https://github.com/webhintio/hint/issues/4137.
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#55
No description provided.