[GH-ISSUE #691] Another false positive MD053 for image inside link #512

Closed
opened 2026-03-03 01:27:35 +03:00 by kerem · 2 comments
Owner

Originally created by @chenxsan on GitHub (Dec 28, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/691

When I ran into the issue, I thought it was same as https://github.com/DavidAnson/markdownlint/issues/571.

But seems it's not after testing the syntax under the latest markdownlint 0.27.0.

Here's the code:

# testing

[![Github][githubicon]](https://github.com/webpack)

[githubicon]: https://rawgit.com/d3viant0ne/awesome-webpack/master/media/github-square.svg

And here's the warning I got:

[MD053 / link-image-reference-definitions](https://github.com/DavidAnson/markdownlint/blob/v0.26.2/doc/Rules.md#md053) Link and image reference definitions should be needed [Unused link or image reference definition: "githubicon"] [Context: "[githubicon]: https://rawgit.c..."]

You can reproduce it under https://dlaa.me/markdownlint/.

Note that the code is valid and github issue can render it like below:

testing

Github

Originally created by @chenxsan on GitHub (Dec 28, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/691 When I ran into the issue, I thought it was same as https://github.com/DavidAnson/markdownlint/issues/571. But seems it's not after testing the syntax under the latest markdownlint 0.27.0. Here's the code: ``` # testing [![Github][githubicon]](https://github.com/webpack) [githubicon]: https://rawgit.com/d3viant0ne/awesome-webpack/master/media/github-square.svg ``` And here's the warning I got: ``` [MD053 / link-image-reference-definitions](https://github.com/DavidAnson/markdownlint/blob/v0.26.2/doc/Rules.md#md053) Link and image reference definitions should be needed [Unused link or image reference definition: "githubicon"] [Context: "[githubicon]: https://rawgit.c..."] ``` You can reproduce it under https://dlaa.me/markdownlint/. Note that the code is valid and github issue can render it like below: # testing [![Github][githubicon]](https://github.com/webpack) [githubicon]: https://rawgit.com/d3viant0ne/awesome-webpack/master/media/github-square.svg
kerem 2026-03-03 01:27:35 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

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

Your example does not produce a warning for me using v0.27.0 of the demo page. Note that the version of the demo page you link to is still running v0.26.2 per the version number in the header. (Your example does produce a warning for me on the previous version.) What are the steps to produce the issue you are reporting with v0.27.0?

<!-- gh-comment-id:1366388311 --> @DavidAnson commented on GitHub (Dec 28, 2022): Your example does not produce a warning for me using `v0.27.0` of the demo page. Note that the version of the demo page you link to is still running `v0.26.2` per the version number in the header. (Your example does produce a warning for me on the previous version.) What are the steps to produce the issue you are reporting with `v0.27.0`?
Author
Owner

@chenxsan commented on GitHub (Dec 28, 2022):

Your example does not produce a warning for me using v0.27.0 of the demo page. Note that the version of the demo page you link to is still running v0.26.2 per the version number in the header. (Your example does produce a warning for me on the previous version.) What are the steps to produce the issue you are reporting with v0.27.0?

Hi David, definitely my fault here. I had both markdownlint v0.27.0 and markdownlint-cli v0.32.2 installed under devDependencies, while the latter has markdownlint@0.26.2 installed as its dependency per https://github.com/igorshubovych/markdownlint-cli/blob/master/package.json#L46. Obviously running markdownlint from npm script would invoke 0.26.2 here.

So guess I'll have to wait for markdownlint-cli to update its markdownlint dependency or use resolutions feature from yarn to work around it:

  "resolutions": {
    "markdownlint-cli/markdownlint": "^0.27.0"
  }
<!-- gh-comment-id:1366544858 --> @chenxsan commented on GitHub (Dec 28, 2022): > Your example does not produce a warning for me using `v0.27.0` of the demo page. Note that the version of the demo page you link to is still running `v0.26.2` per the version number in the header. (Your example does produce a warning for me on the previous version.) What are the steps to produce the issue you are reporting with `v0.27.0`? Hi David, definitely my fault here. I had both `markdownlint` v0.27.0 and `markdownlint-cli` v0.32.2 installed under `devDependencies`, while the latter has `markdownlint@0.26.2` installed as its dependency per https://github.com/igorshubovych/markdownlint-cli/blob/master/package.json#L46. Obviously running `markdownlint` from npm script would invoke 0.26.2 here. So guess I'll have to wait for `markdownlint-cli` to update its `markdownlint` dependency or use `resolutions` feature from `yarn` to work around it: ```json "resolutions": { "markdownlint-cli/markdownlint": "^0.27.0" } ```
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#512
No description provided.