[GH-ISSUE #676] Showing a warning about url encoded special characters when linking to headings #502

Closed
opened 2026-03-03 01:27:30 +03:00 by kerem · 1 comment
Owner

Originally created by @Breigner01 on GitHub (Dec 12, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/676

So basically I have something like this in a markdown:

- [Build & Run](#build-%26-run)

# Build & Run

Which looks something like this:

Build & Run

I first realized that I couldn't use the ampersand character in the link but encoding it for URL works.
The slight "issue" if we can say so, is that markdownlint shows a warning because it thinks the link is not right but the markdown preview plugin that I'm using rightfully redirects to the right heading.

It would be nice to see this plugin interpret URL-encoded characters.

Originally created by @Breigner01 on GitHub (Dec 12, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/676 So basically I have something like this in a markdown: ``` - [Build & Run](#build-%26-run) # Build & Run ``` Which looks something like this: - [Build & Run](#build-%26-run) # Build & Run I first realized that I couldn't use the ampersand character in the link but encoding it for URL works. The slight "issue" if we can say so, is that markdownlint shows a warning because it thinks the link is not right but the markdown preview plugin that I'm using rightfully redirects to the right heading. It would be nice to see this plugin interpret URL-encoded characters.
kerem 2026-03-03 01:27:30 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Dec 12, 2022):

MD051 enforces the GitHub algorithm as described here: https://github.com/DavidAnson/markdownlint/blob/next/doc/md051.md

That algorithm removes punctuation which leads to:

# Build & Run

- [Build & Run](#build--run)

Which produces no errors when linted: https://dlaa.me/markdownlint/#%25m%23%20Build%20%26%20Run%0A%0A-%20%5BBuild%20%26%20Run%5D(%23build--run)%0A

<!-- gh-comment-id:1346604501 --> @DavidAnson commented on GitHub (Dec 12, 2022): MD051 enforces the GitHub algorithm as described here: <https://github.com/DavidAnson/markdownlint/blob/next/doc/md051.md> That algorithm removes punctuation which leads to: ```markdown # Build & Run - [Build & Run](#build--run) ``` Which produces no errors when linted: <https://dlaa.me/markdownlint/#%25m%23%20Build%20%26%20Run%0A%0A-%20%5BBuild%20%26%20Run%5D(%23build--run)%0A>
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#502
No description provided.