[GH-ISSUE #308] [MD042] no-empty-links: every non-empty link after one empty link is also marked as empty #264

Closed
opened 2026-03-03 01:25:14 +03:00 by kerem · 1 comment
Owner

Originally created by @astier on GitHub (Jul 29, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/308

I am not sure this issue should be posted here or on markdownlint-cli. I can migrate it if its wrong here.

Minimal file.md

[link1](https://example.com/)
[link2]()
[link3](https://example.com/)
[link3](https://example.com/)

Steps to reproduce

  1. Create minimal file.md
  2. Execute markdownlint file.md

Actual behavior

The output says link2, link3 and link4 are empty:

md.md:2:1 MD042/no-empty-links No empty links [Context: "[link2]()"]
md.md:3 MD042/no-empty-links No empty links [Context: "[link3]()"]
md.md:4 MD042/no-empty-links No empty links [Context: "[link4]()"]

Expected behavior

Only link2 should be flagged as empty.

Originally created by @astier on GitHub (Jul 29, 2020). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/308 I am not sure this issue should be posted here or on markdownlint-cli. I can migrate it if its wrong here. ### Minimal file.md ```md [link1](https://example.com/) [link2]() [link3](https://example.com/) [link3](https://example.com/) ``` ### Steps to reproduce 1. Create minimal file.md 2. Execute `markdownlint file.md` ### Actual behavior The output says link2, link3 and link4 are empty: ``` md.md:2:1 MD042/no-empty-links No empty links [Context: "[link2]()"] md.md:3 MD042/no-empty-links No empty links [Context: "[link3]()"] md.md:4 MD042/no-empty-links No empty links [Context: "[link4]()"] ``` ### Expected behavior Only link2 should be flagged as empty.
kerem 2026-03-03 01:25:14 +03:00
Author
Owner
<!-- gh-comment-id:666040723 --> @DavidAnson commented on GitHub (Jul 30, 2020): This is the right place for library issues! Here’s your repro in the online demo: https://dlaa.me/markdownlint/#%25m%23%20Issue%20308%0A%0A%5Blink1%5D(https%3A%2F%2Fexample.com%2F)%0A%5Blink2%5D()%0A%5Blink3%5D(https%3A%2F%2Fexample.com%2F)%0A%5Blink3%5D(https%3A%2F%2Fexample.com%2F)%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#264
No description provided.