[PR #495] [CLOSED] feat(rules): add valid-link-fragments #2730

Closed
opened 2026-03-07 20:10:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/DavidAnson/markdownlint/pull/495
Author: @theoludwig
Created: 1/25/2022
Status: Closed

Base: nextHead: feat/add-no-dead-relative-links


📝 Commits (5)

  • 53a99d3 feat(rules): add no-dead-relative-links
  • c0c30d1 feat(rules): add no-dead-hash-links-within-document
  • 22a7e16 fix: address some review feedbacks
  • 371d29b docs(rules): add link for #m051 section
  • f394468 fix: address some feedback again

📊 Changes

13 files changed (+250 additions, -24 deletions)

View changed files

📝 README.md (+2 -1)
📝 demo/markdownlint-browser.js (+54 -1)
📝 doc/Rules.md (+27 -2)
lib/md051.js (+46 -0)
📝 lib/rules.js (+2 -1)
📝 schema/.markdownlint.jsonc (+4 -1)
📝 schema/.markdownlint.yaml (+4 -1)
📝 schema/markdownlint-config-schema.json (+11 -1)
📝 test/detailed-results-MD041-MD050.results.json (+26 -0)
📝 test/empty-links.md (+8 -6)
📝 test/markdownlint-test.js (+3 -3)
📝 test/spaces_inside_codespan_elements.md (+7 -7)
test/valid-link-fragments.md (+56 -0)

📄 Description

Hey! 👋

This PR adds a new built-in rule: valid-link-fragments to ensure that link fragments are valid within the document.

Even if you recommend first implementing it as a custom rule as an npm package, I think that we could instead disable the rule by default and let the user enable it in their config, and if successful, we enable it by default (in the current implementation of the PR, the rule is enabled by default).

I left some comments to discuss the "know issues" and things that could be implemented in this PR.

fix #253


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/DavidAnson/markdownlint/pull/495 **Author:** [@theoludwig](https://github.com/theoludwig) **Created:** 1/25/2022 **Status:** ❌ Closed **Base:** `next` ← **Head:** `feat/add-no-dead-relative-links` --- ### 📝 Commits (5) - [`53a99d3`](https://github.com/DavidAnson/markdownlint/commit/53a99d332c7091ea137d3750e0624454f1c21de9) feat(rules): add `no-dead-relative-links` - [`c0c30d1`](https://github.com/DavidAnson/markdownlint/commit/c0c30d1523a87a66dd596de8289a0d479f28618c) feat(rules): add `no-dead-hash-links-within-document` - [`22a7e16`](https://github.com/DavidAnson/markdownlint/commit/22a7e16e414c88bc23105d90a7126f8674209227) fix: address some review feedbacks - [`371d29b`](https://github.com/DavidAnson/markdownlint/commit/371d29bcdfdb1c5294e46faff1e9605b3b92d740) docs(rules): add link for #m051 section - [`f394468`](https://github.com/DavidAnson/markdownlint/commit/f394468ac4cdf283e86fdac2c3711d552d08e7de) fix: address some feedback again ### 📊 Changes **13 files changed** (+250 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+2 -1) 📝 `demo/markdownlint-browser.js` (+54 -1) 📝 `doc/Rules.md` (+27 -2) ➕ `lib/md051.js` (+46 -0) 📝 `lib/rules.js` (+2 -1) 📝 `schema/.markdownlint.jsonc` (+4 -1) 📝 `schema/.markdownlint.yaml` (+4 -1) 📝 `schema/markdownlint-config-schema.json` (+11 -1) 📝 `test/detailed-results-MD041-MD050.results.json` (+26 -0) 📝 `test/empty-links.md` (+8 -6) 📝 `test/markdownlint-test.js` (+3 -3) 📝 `test/spaces_inside_codespan_elements.md` (+7 -7) ➕ `test/valid-link-fragments.md` (+56 -0) </details> ### 📄 Description Hey! :wave: This PR adds a new built-in rule: `valid-link-fragments` to ensure that link fragments are valid within the document. Even if you recommend first implementing it as a custom rule as an npm package, I think that we could instead disable the rule by default and let the user enable it in their config, and if successful, we enable it by default (in the current implementation of the PR, the rule is enabled by default). I left some comments to discuss the "know issues" and things that could be implemented in this PR. fix #253 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-07 20:10:18 +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#2730
No description provided.