[GH-ISSUE #945] MD051: False-positive if the header itself is a link #2410

Closed
opened 2026-03-07 20:07:31 +03:00 by kerem · 2 comments
Owner

Originally created by @sschuberth on GitHub (Aug 30, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/945

In our README, code like

#### [ORT configuration file](./model/src/main/resources/reference.yml)

triggers MD051 for a reference like

[ORT configuration file](#ort-configuration-file)

I guess this happens because the linter does not recognize the link syntax in the heading.

PS: This seem like a regression in markdownlint v0.30.0 as markdownlint v0.29.0 did not complain.

Originally created by @sschuberth on GitHub (Aug 30, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/945 In our [README](https://github.com/oss-review-toolkit/ort/blob/main/README.md), code like #### [ORT configuration file](./model/src/main/resources/reference.yml) triggers [MD051](https://github.com/DavidAnson/markdownlint/blob/v0.30.0/doc/md051.md) for a reference like [ORT configuration file](#ort-configuration-file) I guess this happens because the linter does not recognize the link syntax in the heading. PS: This seem like a regression in markdownlint v0.30.0 as markdownlint v0.29.0 did not complain.
kerem 2026-03-07 20:07:31 +03:00
Author
Owner

@philrz commented on GitHub (Sep 4, 2023):

It looks like we've bumped into this one as well. We've got a markdown file at https://github.com/brimdata/zed/blob/main/docs/tutorials/schools.md that's always checked clean in the past but started showing these MD051 failures once markdownlint v0.30.0 was in use.

In our case a reference looks like:

[Boolean `and`](#541-and)

with the corresponding header looking like:

#### 5.4.1 [and](../language/aggregates/and.md)
<!-- gh-comment-id:1705638999 --> @philrz commented on GitHub (Sep 4, 2023): It looks like we've bumped into this one as well. We've got a markdown file at https://github.com/brimdata/zed/blob/main/docs/tutorials/schools.md that's always checked clean in the past but started showing these MD051 failures once markdownlint v0.30.0 was in use. In our case a reference looks like: ``` [Boolean `and`](#541-and) ``` with the corresponding header looking like: ``` #### 5.4.1 [and](../language/aggregates/and.md) ```
Author
Owner

@DavidAnson commented on GitHub (Sep 4, 2023):

Good timing, @philrz - I verified that your example is fixed by the change I just made for the original example by @sschuberth.

<!-- gh-comment-id:1705641925 --> @DavidAnson commented on GitHub (Sep 4, 2023): Good timing, @philrz - I verified that your example is fixed by the change I just made for the original example by @sschuberth.
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#2410
No description provided.