DavidAnson/markdownlint-cli2

MD025 conflicts with YAML front matter metadata

mbrancato opened this issue · 2 comments

I don't think MD025 should conflict with YAML front matter as it's not rendered by markdown.

Example foo.md:

---
title: This is My Front Matter Title
---
# This is My Markdown Title

result:

% markdownlint-cli2 foo.md
markdownlint-cli2 v0.9.2 (markdownlint v0.30.0)
Finding: foo.md
Linting: 1 file(s)
Summary: 1 error(s)
foo.md:4 MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "# This is My Markdown Title"]

Just to clarify, the same issue is raised when the front matter and h1 title are the same values as well. The example above is just to illustrate it.

The documentation explains why the YAML title is examined by this rule and shows how to disable that behavior: https://github.com/DavidAnson/markdownlint/blob/main/doc/md025.md

Oh, thanks so much for the quick response. That's a great solution.