[GH-ISSUE #77] MD041: incorrect frontmatter title checking with TOML frontmatter #62

Closed
opened 2026-03-03 01:23:24 +03:00 by kerem · 1 comment
Owner

Originally created by @ringods on GitHub (Oct 14, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/77

Support for #63 was done in commit github.com/DavidAnson/markdownlint@5bea80f5cd. But in my VSCode 1.17.1 with markdownlint extension 0.10.1, I still get MD041 complaints on my Markdown files with TOML frontmatter.

Each of my MD files contain a title attribute in the frontmatter, followed by plain text e.g.:

+++
date = "2017-01-26T22:17:00+02:00"
title = "My document title and header"
+++

Some plain text here.

Hugo renders the title as the top level h1 element with the theme I use.

Looking at the markdownlint sources, I suspect the check for the frontmatter title attribute only checks for the YAML version:

github.com/DavidAnson/markdownlint@edd426bbaa/lib/rules.js (L1048)

The regexp ends with the colon at the end, but in TOML key and value are separated with the equal sign and spaces in between. Can you confirm this?

Originally created by @ringods on GitHub (Oct 14, 2017). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/77 Support for #63 was done in commit https://github.com/DavidAnson/markdownlint/commit/5bea80f5cd8685183268e5f53eb5f94a4f4b8a69. But in my VSCode 1.17.1 with markdownlint extension 0.10.1, I still get `MD041` complaints on my Markdown files with TOML frontmatter. Each of my MD files contain a `title` attribute in the frontmatter, followed by plain text e.g.: ``` +++ date = "2017-01-26T22:17:00+02:00" title = "My document title and header" +++ Some plain text here. ``` Hugo renders the `title` as the top level `h1` element with the theme I use. Looking at the `markdownlint` sources, I suspect the check for the frontmatter title attribute only checks for the YAML version: https://github.com/DavidAnson/markdownlint/blob/edd426bbaa2f2b817e818153e392332e51b7b98d/lib/rules.js#L1048 The regexp ends with the colon at the end, but in TOML key and value are separated with the equal sign and spaces in between. Can you confirm this?
kerem 2026-03-03 01:23:24 +03:00
Author
Owner

@DavidAnson commented on GitHub (Oct 14, 2017):

Seems legit, sorry about that. The other commit of interest is github.com/DavidAnson/markdownlint@942f0600d2 which was before the TOML one you cite. This should be straightforward to fix. I’m working on a vscode-markdownlint update now and may roll this fix in. Thanks!

<!-- gh-comment-id:336650686 --> @DavidAnson commented on GitHub (Oct 14, 2017): Seems legit, sorry about that. The other commit of interest is https://github.com/DavidAnson/markdownlint/commit/942f0600d218cd4c393da41fb599b14bb3d0e46b which was before the TOML one you cite. This should be straightforward to fix. I’m working on a `vscode-markdownlint` update now and may roll this fix in. Thanks!
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#62
No description provided.