markdownlint icon indicating copy to clipboard operation
markdownlint copied to clipboard

Add rule(s) to enforce certain link rules

Open braebot opened this issue 8 years ago • 3 comments

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.

braebot avatar Jul 22 '17 04:07 braebot

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

DavidAnson avatar Jul 22 '17 05:07 DavidAnson

Yes, that would be sufficient!

braebot avatar Jul 22 '17 07:07 braebot

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

sanmai-NL avatar Nov 20 '20 10:11 sanmai-NL