[GH-ISSUE #329] MD044: Names match in links with URL-encoded spacing #283

Closed
opened 2026-03-03 01:25:24 +03:00 by kerem · 4 comments
Owner

Originally created by @lxp on GitHub (Sep 14, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/329

I use markdownlint version 0.20.4 with the following configuration for MD044:

  "proper-names": {
      "names": [
          "PDF"
      ],
      "code_blocks": false
  }

My problem is that MD044 also matches certain URLs.

Example 1, which fails with Proper names should have the correct capitalization [Expected: PDF; Actual: pdf]:
<https://www.example.org/test%20test.pdf>

Example 2, which passes without any error (the expected behavior):
<https://www.example.org/testtest.pdf>

The problem seems to be URL-encoded spacing (at least %20 and %0a seem to fail).

Originally created by @lxp on GitHub (Sep 14, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/329 I use markdownlint version 0.20.4 with the following configuration for MD044: ``` "proper-names": { "names": [ "PDF" ], "code_blocks": false } ``` My problem is that MD044 also matches certain URLs. Example 1, which fails with `Proper names should have the correct capitalization [Expected: PDF; Actual: pdf]`: `<https://www.example.org/test%20test.pdf>` Example 2, which passes without any error (the expected behavior): `<https://www.example.org/testtest.pdf>` The problem seems to be URL-encoded spacing (at least `%20` and `%0a` seem to fail).
kerem 2026-03-03 01:25:24 +03:00
Author
Owner
<!-- gh-comment-id:692346288 --> @DavidAnson commented on GitHub (Sep 14, 2020): It seems to report both cases to me, see below. It does NOT seem to report a similar case with normal link syntax, so the improvement here may be to exclude the angle bracket link syntax you use. https://dlaa.me/markdownlint/#%25m%23%20Issue%20329%0A%0AExample%201%2C%20which%20fails%20with%20Proper%20names%20should%20have%20the%20correct%20capitalization%20%5BExpected%3A%20PDF%3B%20Actual%3A%20pdf%5D%3A%0A%3Chttps%3A%2F%2Fwww.example.org%2Ftest%2520test.pdf%3E%0A%0AExample%202%2C%20which%20passes%20without%20any%20error%20(the%20expected%20behavior)%3A%0A%3Chttps%3A%2F%2Fwww.example.org%2Ftesttest.pdf%3E%0A%0A%5BExample%203%5D(https%3A%2F%2Fwww.example.org%2Ftesttest.pdf)%0A%0A%3C!--%20markdownlint-configure-file%20%7B%0A%20%20%22proper-names%22%3A%20%7B%0A%20%20%20%20%22names%22%3A%20%5B%0A%20%20%20%20%20%20%22PDF%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22code_blocks%22%3A%20false%0A%20%20%7D%0A%7D%0A--%3E%0A
Author
Owner

@lxp commented on GitHub (Sep 15, 2020):

It is the same in your example. If you look closely, an error is reported for line 3 (error text) and 4 (angle bracket link with spacing), but not for line 7 (angle bracket link without spacing) and 9 (other link syntax without spacing). Line 3 is reported because of the error text [Expected: PDF; Actual: pdf] also contains pdf in lower case.

<!-- gh-comment-id:692879443 --> @lxp commented on GitHub (Sep 15, 2020): It is the same in your example. If you look closely, an error is reported for line 3 (error text) and 4 (angle bracket link with spacing), but not for line 7 (angle bracket link without spacing) and 9 (other link syntax without spacing). Line 3 is reported because of the error text `[Expected: PDF; Actual: pdf]` also contains pdf in lower case.
Author
Owner

@DavidAnson commented on GitHub (Sep 15, 2020):

Yes, thanks, I read the 4 as a 7 the first time, somehow!

<!-- gh-comment-id:692884900 --> @DavidAnson commented on GitHub (Sep 15, 2020): Yes, thanks, I read the 4 as a 7 the first time, somehow!
Author
Owner

@lxp commented on GitHub (Sep 25, 2020):

Thanks! The fix works for me.

<!-- gh-comment-id:699039293 --> @lxp commented on GitHub (Sep 25, 2020): Thanks! The fix works for me.
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#283
No description provided.