[GH-ISSUE #325] markdownlint-rule-github-internal-links #2127

Closed
opened 2026-03-07 20:04:50 +03:00 by kerem · 3 comments
Owner

Originally created by @edemaine on GitHub (Aug 30, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/325

(Until we have Discussion forums everywhere, this seems like the best way to mention the following:)

I just wrote a custom markdownlint rule that checks all internal links according to the anchor generation that Github does in its Markdown rendered (e.g. for README.md files). Because anchor generation is specific to the Markdown renderer, I figured a custom rule made more sense than a PR to markdownlint itself, but I'm happy to submit a PR if you'd rather.

I think I got everything right, including the NPM keywords, but this is my first contribution "to" markdownlint, so let me know if you see anything I could improve.

I tested it on this pretty complicated Markdown file which includes fun features like <img> tags in the headings. (Testing all the links in this document was my motivation for writing this plugin.)

Anyway, hope this is helpful, and thanks for the great tool! Writing a plugin was quite straightforward. Feel free to close this issue.

Originally created by @edemaine on GitHub (Aug 30, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/325 (Until we have Discussion forums everywhere, this seems like the best way to mention the following:) I just wrote a custom markdownlint rule that checks all internal links according to the anchor generation that Github does in its Markdown rendered (e.g. for `README.md` files). Because anchor generation is specific to the Markdown renderer, I figured a custom rule made more sense than a PR to markdownlint itself, but I'm happy to submit a PR if you'd rather. * [NPM link](https://www.npmjs.com/package/markdownlint-rule-github-internal-links) * [Github link](https://github.com/edemaine/markdownlint-rule-github-internal-links) I think I got everything right, including the NPM keywords, but this is my first contribution "to" markdownlint, so let me know if you see anything I could improve. I tested it on [this pretty complicated Markdown file](https://github.com/edemaine/cocreate/blob/master/doc/README.md) which includes fun features like `<img>` tags in the headings. (Testing all the links in this document was my motivation for writing this plugin.) Anyway, hope this is helpful, and thanks for the great tool! Writing a plugin was quite straightforward. Feel free to close this issue.
kerem closed this issue 2026-03-07 20:04:50 +03:00
Author
Owner

@DavidAnson commented on GitHub (Aug 30, 2020):

This is awesome, thanks for sharing! I will give it a try soon and maybe add it to my nightly CI run. I see you have already added the appropriate keyword, so it shows up at https://www.npmjs.com/search?q=keywords:markdownlint-rule where others will be able to find it easily. Congratulations!

FYI, you may want to mention https://github.com/DavidAnson/markdownlint-cli2 in your notes. It's a very new project I started as an alternative to the original CLI.

<!-- gh-comment-id:683447408 --> @DavidAnson commented on GitHub (Aug 30, 2020): This is awesome, thanks for sharing! I will give it a try soon and maybe add it to my nightly CI run. I see you have already added the appropriate keyword, so it shows up at https://www.npmjs.com/search?q=keywords:markdownlint-rule where others will be able to find it easily. Congratulations! FYI, you _may_ want to mention https://github.com/DavidAnson/markdownlint-cli2 in your notes. It's a very new project I started as an alternative to the original CLI.
Author
Owner

@DavidAnson commented on GitHub (Aug 30, 2020):

I'm not a CoffeeScript person, but a quick scan of your implementation looked perfectly reasonable. Thanks again for doing this!

<!-- gh-comment-id:683447881 --> @DavidAnson commented on GitHub (Aug 30, 2020): I'm not a CoffeeScript person, but a quick scan of your implementation looked perfectly reasonable. Thanks again for doing this!
Author
Owner

@edemaine commented on GitHub (Aug 30, 2020):

Thanks! I hadn't looked at markdownlint-cli2 much yet, but just figured out how to use it with custom rules, and added corresponding documentation to the README. Nice that you can specify custom rules in the config instead of the command line!

<!-- gh-comment-id:683449968 --> @edemaine commented on GitHub (Aug 30, 2020): Thanks! I hadn't looked at markdownlint-cli2 much yet, but just figured out how to use it with custom rules, and added corresponding documentation to the README. Nice that you can specify custom rules in the config instead of the command line!
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#2127
No description provided.