[PR #845] [MERGED] Add MD054/link-style #2906

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

📋 Pull Request Information

Original PR: https://github.com/DavidAnson/markdownlint/pull/845
Author: @tommy-gilligan
Created: 5/31/2023
Status: Merged
Merged: 10/25/2023
Merged by: @DavidAnson

Base: md054Head: next


📝 Commits (10+)

  • 6057bcf Add MD054/link-style
  • 4d391d4 Update break all the rules for MD054 link style
  • 19f19bc Add more context to MD054 error
  • 9c3ef44 fix: Forgot to update demo/markdownlint-browser.js
  • cad0f7d Add reference -> inline fix to MD054
  • d9057bc Refactor MD054 Link styles
  • aee8a19 Bring in PR feedback for MD054
  • 6353a32 Update documentation from PR feedback
  • 69fc8c4 Duplicate some doc fixes MD054 -> MD053
  • 8aa97fd Make link style tests sensitive to column offset

📊 Changes

26 files changed (+1140 additions, -25 deletions)

View changed files

📝 README.md (+4 -2)
📝 demo/markdownlint-browser.js (+126 -2)
📝 doc-build/md053.md (+3 -3)
doc-build/md054.md (+11 -0)
📝 doc/Rules.md (+31 -3)
📝 doc/md053.md (+3 -3)
doc/md054.md (+25 -0)
📝 lib/constants.js (+2 -1)
lib/md054.js (+134 -0)
📝 lib/rules.js (+2 -1)
📝 micromark/exports-html.mjs (+1 -1)
📝 micromark/exports.mjs (+3 -3)
📝 schema/.markdownlint.jsonc (+6 -0)
📝 schema/.markdownlint.yaml (+5 -0)
📝 schema/build-config-schema.js (+18 -0)
📝 schema/markdownlint-config-schema.json (+30 -2)
test/link-style-autolink-only.md (+20 -0)
test/link-style-inline-only.md (+20 -0)
test/link-style-inline-or-autolink.md (+20 -0)
test/link-style-inline-or-reference.md (+20 -0)

...and 6 more files

📄 Description

Discussion on #40 issue has not yet been concluded so this is probably a bit premature.

Should autolinks be allowed?

Tentatitve decision: Autolinks should be ignored

Allow inline-style links in lists only

Another possible criteria for which link style to use: whether or not the link destination is relative

It would also be nice if this was configurable by the length of the URL — i.e. non-reference links shorter than N characters would not trigger this rule, with the default max length being 0.

Tentatitve decision: All of these should be configurable but it is not clear to me what that should look like in the schema. I've skipped this for now.


🔄 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/845 **Author:** [@tommy-gilligan](https://github.com/tommy-gilligan) **Created:** 5/31/2023 **Status:** ✅ Merged **Merged:** 10/25/2023 **Merged by:** [@DavidAnson](https://github.com/DavidAnson) **Base:** `md054` ← **Head:** `next` --- ### 📝 Commits (10+) - [`6057bcf`](https://github.com/DavidAnson/markdownlint/commit/6057bcfcbd8e00688f28bc4f61937d0ee11eb113) Add MD054/link-style - [`4d391d4`](https://github.com/DavidAnson/markdownlint/commit/4d391d407ce946d284d8b02879751b8e8af363ca) Update break all the rules for MD054 link style - [`19f19bc`](https://github.com/DavidAnson/markdownlint/commit/19f19bce65e35adfa059f140dd4fb2c70788be03) Add more context to MD054 error - [`9c3ef44`](https://github.com/DavidAnson/markdownlint/commit/9c3ef44e5795db1ad9d3855d067a9a8c487e00f5) fix: Forgot to update demo/markdownlint-browser.js - [`cad0f7d`](https://github.com/DavidAnson/markdownlint/commit/cad0f7d6e55fa736c6dbd74dc0f334069a9d4623) Add reference -> inline fix to MD054 - [`d9057bc`](https://github.com/DavidAnson/markdownlint/commit/d9057bc9e587f1db04bd34dfd2fb1ee363b00bd7) Refactor MD054 Link styles - [`aee8a19`](https://github.com/DavidAnson/markdownlint/commit/aee8a19607531d17cbc82eba444551be9c10c2fd) Bring in PR feedback for MD054 - [`6353a32`](https://github.com/DavidAnson/markdownlint/commit/6353a3291c2166cd1c2d710efae1f04baea8a530) Update documentation from PR feedback - [`69fc8c4`](https://github.com/DavidAnson/markdownlint/commit/69fc8c49d09a11a8685900e513206ad539afe3f7) Duplicate some doc fixes MD054 -> MD053 - [`8aa97fd`](https://github.com/DavidAnson/markdownlint/commit/8aa97fdc0994a105345dab7bccb918c4df0f6ce1) Make link style tests sensitive to column offset ### 📊 Changes **26 files changed** (+1140 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+4 -2) 📝 `demo/markdownlint-browser.js` (+126 -2) 📝 `doc-build/md053.md` (+3 -3) ➕ `doc-build/md054.md` (+11 -0) 📝 `doc/Rules.md` (+31 -3) 📝 `doc/md053.md` (+3 -3) ➕ `doc/md054.md` (+25 -0) 📝 `lib/constants.js` (+2 -1) ➕ `lib/md054.js` (+134 -0) 📝 `lib/rules.js` (+2 -1) 📝 `micromark/exports-html.mjs` (+1 -1) 📝 `micromark/exports.mjs` (+3 -3) 📝 `schema/.markdownlint.jsonc` (+6 -0) 📝 `schema/.markdownlint.yaml` (+5 -0) 📝 `schema/build-config-schema.js` (+18 -0) 📝 `schema/markdownlint-config-schema.json` (+30 -2) ➕ `test/link-style-autolink-only.md` (+20 -0) ➕ `test/link-style-inline-only.md` (+20 -0) ➕ `test/link-style-inline-or-autolink.md` (+20 -0) ➕ `test/link-style-inline-or-reference.md` (+20 -0) _...and 6 more files_ </details> ### 📄 Description Discussion on #40 issue has not yet been concluded so this is probably a bit premature. > Should autolinks be allowed? Tentatitve decision: Autolinks should be ignored > Allow inline-style links in lists only > Another possible criteria for which link style to use: whether or not the link destination is relative > It would also be nice if this was configurable by the length of the URL — i.e. non-reference links shorter than N characters would not trigger this rule, with the default max length being 0. Tentatitve decision: All of these should be configurable but it is not clear to me what that should look like in the schema. I've skipped this for now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-07 20:11:10 +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#2906
No description provided.