-
-
Notifications
You must be signed in to change notification settings - Fork 863
Closed
Labels
Description
Rule MD053 incorrectly complains about an unused link definition when the link usage:
- Spans 2 lines
- Is in a blockquote
Reproducing
The following MarkDown file should reproduce the error:
<!-- error.md -->
# Example Blockquotes
Example 1: newline in link, working
> Find out more in the GitHub Actions documentation on [`push` events], [branch
> and tag filters], and [path filters].
Example 2: newline in link, not working
> Find out more in the GitHub Actions documentation on [`repository_dispatch`
> events] and [`workflow_dispatch` events].
[`pull_request` events]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request
[`push` events]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push
[`repository_dispatch` events]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
[`workflow_dispatch` events]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
[branch and tag filters]: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
[path filters]: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpathsResult:
$ npx markdownlint error.md
error.md:20:1 MD053/link-image-reference-definitions Link and image reference definitions should be needed [Unused link or image reference definition: "`repository_dispatch` events"] [Context: "[`repository_dispatch` events]..."]When removing the blockquotes, the problem is no longer reporter.
<!-- success.md -->
# Example No Blockquotes
Example 1: newline in link, working
Find out more in the GitHub Actions documentation on [`push` events], [branch
and tag filters], and [path filters].
Example 2: newline in link, not working
Find out more in the GitHub Actions documentation on [`repository_dispatch`
events] and [`workflow_dispatch` events].
[`pull_request` events]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request
[`push` events]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push
[`repository_dispatch` events]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#repository_dispatch
[`workflow_dispatch` events]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
[branch and tag filters]: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
[path filters]: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpathsResult:
$ npx markdownlint success.md(These examples are based on the documentation for ericcornelissen/svgo-action, where I first encountered this bug.)