[PR #1617] [MERGED] MD001: Support front matter title as the first heading of the page #3416

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

📋 Pull Request Information

Original PR: https://github.com/DavidAnson/markdownlint/pull/1617
Author: @afeblot
Created: 5/27/2025
Status: Merged
Merged: 6/7/2025
Merged by: @DavidAnson

Base: nextHead: feature/md001-frontmatter-title


📝 Commits (2)

  • 91df188 MD001/heading-increment: Support front matter title as the first heading of the page (fixes #1613).
  • 2ee67b2 Update heading_increment-title_level3_bad.md

📊 Changes

21 files changed (+317 additions, -16 deletions)

View changed files

📝 doc-build/md001.md (+9 -0)
📝 doc/Rules.md (+14 -0)
📝 doc/md001.md (+14 -0)
📝 lib/configuration-strict.d.ts (+16 -2)
📝 lib/md001.mjs (+6 -2)
📝 schema/.markdownlint.jsonc (+4 -1)
📝 schema/.markdownlint.yaml (+3 -1)
📝 schema/build-config-schema.mjs (+9 -0)
📝 schema/markdownlint-config-schema-strict.json (+26 -4)
📝 schema/markdownlint-config-schema.json (+26 -4)
test/heading_increment-alt_title_level3_bad.md (+14 -0)
test/heading_increment-title_level2_good.md (+7 -0)
test/heading_increment-title_level3_bad.md (+5 -0)
📝 test/markdownlint-test.mjs (+1 -1)
📝 test/snapshots/markdownlint-test-repos-dotnet-docs.mjs.snap (+0 -0)
📝 test/snapshots/markdownlint-test-repos-mdn-content.mjs.md (+78 -1)
📝 test/snapshots/markdownlint-test-repos-mdn-content.mjs.snap (+0 -0)
📝 test/snapshots/markdownlint-test-repos-small.mjs.md (+4 -0)
📝 test/snapshots/markdownlint-test-repos-small.mjs.snap (+0 -0)
📝 test/snapshots/markdownlint-test-scenarios.mjs.md (+81 -0)

...and 1 more files

📄 Description

Consistently with rules 25 and 41, this brings support for front matter title as the first heading of the page, which will by default be considered as a level 1 heading, unless a level is explicitly configured.

Cf. https://github.com/DavidAnson/markdownlint/issues/1613

@DavidAnson,

  • This change does not break any of the 611 tests and provides the behavior I think is approppriate for MD001 goal with a front matter title.
  • It will definitely report things which were not previously, i.e. we can consider it a breaking change, but as far as I saw, that is not an issue with Mardownlint, which does sometimes add new rules as well, and enabled by default.
  • Please let me know what you think about the rule change. If you're ok to move on, I'll add tests, schema and so on.

🔄 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/1617 **Author:** [@afeblot](https://github.com/afeblot) **Created:** 5/27/2025 **Status:** ✅ Merged **Merged:** 6/7/2025 **Merged by:** [@DavidAnson](https://github.com/DavidAnson) **Base:** `next` ← **Head:** `feature/md001-frontmatter-title` --- ### 📝 Commits (2) - [`91df188`](https://github.com/DavidAnson/markdownlint/commit/91df188173786f2538345d2fa3b070590fbf7373) MD001/heading-increment: Support front matter title as the first heading of the page (fixes #1613). - [`2ee67b2`](https://github.com/DavidAnson/markdownlint/commit/2ee67b211f048c47b28f676a2dbc1a8f1d21ad90) Update heading_increment-title_level3_bad.md ### 📊 Changes **21 files changed** (+317 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `doc-build/md001.md` (+9 -0) 📝 `doc/Rules.md` (+14 -0) 📝 `doc/md001.md` (+14 -0) 📝 `lib/configuration-strict.d.ts` (+16 -2) 📝 `lib/md001.mjs` (+6 -2) 📝 `schema/.markdownlint.jsonc` (+4 -1) 📝 `schema/.markdownlint.yaml` (+3 -1) 📝 `schema/build-config-schema.mjs` (+9 -0) 📝 `schema/markdownlint-config-schema-strict.json` (+26 -4) 📝 `schema/markdownlint-config-schema.json` (+26 -4) ➕ `test/heading_increment-alt_title_level3_bad.md` (+14 -0) ➕ `test/heading_increment-title_level2_good.md` (+7 -0) ➕ `test/heading_increment-title_level3_bad.md` (+5 -0) 📝 `test/markdownlint-test.mjs` (+1 -1) 📝 `test/snapshots/markdownlint-test-repos-dotnet-docs.mjs.snap` (+0 -0) 📝 `test/snapshots/markdownlint-test-repos-mdn-content.mjs.md` (+78 -1) 📝 `test/snapshots/markdownlint-test-repos-mdn-content.mjs.snap` (+0 -0) 📝 `test/snapshots/markdownlint-test-repos-small.mjs.md` (+4 -0) 📝 `test/snapshots/markdownlint-test-repos-small.mjs.snap` (+0 -0) 📝 `test/snapshots/markdownlint-test-scenarios.mjs.md` (+81 -0) _...and 1 more files_ </details> ### 📄 Description Consistently with rules 25 and 41, this brings support for front matter title as the first heading of the page, which will by default be considered as a level 1 heading, unless a level is explicitly configured. Cf. https://github.com/DavidAnson/markdownlint/issues/1613 @DavidAnson, - This change does not break any of the 611 tests and provides the behavior I think is approppriate for MD001 goal with a front matter title. - It will definitely report things which were not previously, i.e. we can consider it a breaking change, but as far as I saw, that is not an issue with Mardownlint, which does sometimes add new rules as well, and enabled by default. - **Please let me know what you think about the rule change. If you're ok to move on, I'll add tests, schema and so on.** --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-07 20:13:39 +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#3416
No description provided.