[GH-ISSUE #1482] Dollar signs confuse the linter with links #696

Closed
opened 2026-03-03 01:29:09 +03:00 by kerem · 2 comments
Owner

Originally created by @mtlynch on GitHub (Feb 6, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1482

I ran into a strange issue where dollar signs seem to confuse the linter into thinking a bare URL exists when it's actually a link:

$ cat example.md 
# Test

$4 is more than [$1](https://example.com).
$ markdownlint-cli2 example.md 
markdownlint-cli2 v0.17.2 (markdownlint v0.37.4)
Finding: example.md
Linting: 1 file(s)
Summary: 1 error(s)
example.md:3:22 MD034/no-bare-urls Bare URL used [Context: "https://example.com"]
Originally created by @mtlynch on GitHub (Feb 6, 2025). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1482 I ran into a strange issue where dollar signs seem to confuse the linter into thinking a bare URL exists when it's actually a link: ```bash $ cat example.md # Test $4 is more than [$1](https://example.com). ``` ```bash $ markdownlint-cli2 example.md markdownlint-cli2 v0.17.2 (markdownlint v0.37.4) Finding: example.md Linting: 1 file(s) Summary: 1 error(s) example.md:3:22 MD034/no-bare-urls Bare URL used [Context: "https://example.com"] ```
kerem 2026-03-03 01:29:09 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Feb 6, 2025):

The rendering of this in the demo app indicates it is being purchased as a math expression and so the message is correct. You can backlash escape the first $ to avoid this.

https://dlaa.me/markdownlint/#%25m%23%20Test%0A%0A%244%20is%20more%20than%20%5B%241%5D(https%3A%2F%2Fexample.com).%0A

<!-- gh-comment-id:2640945620 --> @DavidAnson commented on GitHub (Feb 6, 2025): The rendering of this in the demo app indicates it is being purchased as a math expression and so the message is correct. You can backlash escape the first $ to avoid this. https://dlaa.me/markdownlint/#%25m%23%20Test%0A%0A%244%20is%20more%20than%20%5B%241%5D(https%3A%2F%2Fexample.com).%0A
Author
Owner

@mtlynch commented on GitHub (Feb 6, 2025):

Ah, I see. Thanks for the clarification!

<!-- gh-comment-id:2640969352 --> @mtlynch commented on GitHub (Feb 6, 2025): Ah, I see. Thanks for the clarification!
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#696
No description provided.