[GH-ISSUE #960] MD051: False-positive if the header begins with -- #569

Closed
opened 2026-03-03 01:28:06 +03:00 by kerem · 2 comments
Owner

Originally created by @mrazauskas on GitHub (Sep 8, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/960

The following:

## `--config`

The path to a configuration file.

See [`--config`](#config).

Gets reported as: MD051/link-fragments: Link fragments should be valid

Did I miss something? (;

Playground link: https://dlaa.me/markdownlint/#%25m%23%20Docs%0A%0A%23%23%20%60--config%60%0A%0AThe%20path%20to%20a%20configuration%20file.%0A%0ASee%20%5B%60--config%60%5D(%23config)%0A

Originally created by @mrazauskas on GitHub (Sep 8, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/960 The following: ```md ## `--config` The path to a configuration file. See [`--config`](#config). ``` Gets reported as: MD051/link-fragments: Link fragments should be valid Did I miss something? (; Playground link: https://dlaa.me/markdownlint/#%25m%23%20Docs%0A%0A%23%23%20%60--config%60%0A%0AThe%20path%20to%20a%20configuration%20file.%0A%0ASee%20%5B%60--config%60%5D(%23config)%0A
kerem 2026-03-03 01:28:06 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

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

GitHub rules translate that heading into: #--config

If you update your demonstration to use that, no warning is produced.

<!-- gh-comment-id:1712119318 --> @DavidAnson commented on GitHub (Sep 8, 2023): GitHub rules translate that heading into: #--config If you update your demonstration to use that, no warning is produced.
Author
Owner

@mrazauskas commented on GitHub (Sep 9, 2023):

Thanks. Yes, your suggestion works as expected.

I was misguided by VS Code autocompletions:

Screenshot 2023-09-09 at 07 19 52
<!-- gh-comment-id:1712410017 --> @mrazauskas commented on GitHub (Sep 9, 2023): Thanks. Yes, your suggestion works as expected. I was misguided by VS Code autocompletions: <img width="383" alt="Screenshot 2023-09-09 at 07 19 52" src="https://github.com/DavidAnson/markdownlint/assets/72159681/5e5d4baf-8980-4639-b5e7-1d1802e53e7e">
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#569
No description provided.