mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #894] False positive for MD053 when link follows inline HTML #546
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#546
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @philoserf on GitHub (Jul 3, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/894
Given
Markdownlint identifies
[this link]&[and this link]as unreferenced.Given
Markdownlint does not identify
[this link]&[and this link]as unreferenced.@DavidAnson commented on GitHub (Jul 3, 2023):
I believe this is correct per the CommonMark specification. Because there is no empty line between the HTML and following content in your first example, it gets treated as part of the same block instead of as Markdown. You can see that neither of the things after that tag are treated as links by the parser and therefore the corresponding link reference definitions are indeed unused:
https://markdown-it.github.io/#md3=%7B%22source%22%3A%22Text%20with%20a%20%5Blink%5D%20and%20%5Banother%20link%5D.%5Cn%5Cn%3Chr%3E%20%3C!--%20inline%20html%20--%3E%5Cn%5Bthis%20link%5D%20%7C%20%5Band%20this%20link%5D%5Cn%5Cn%3C!--%20references%20--%3E%5Cn%5Blink%5D%3A%20https%3A%2F%2Fexamples.com%2Flink%5Cn%5Banother%20link%5D%3A%20https%3A%2F%2Fexamples.com%2Fanother%2Blink%5Cn%5Bthis%20link%5D%3A%20https%3A%2F%2Fexamples.com%2Fthis%2Blink%5Cn%5Band%20this%20link%5D%3A%20https%3A%2F%2Fexamples.com%2Fand%2Bthis%2Blink%22%2C%22defaults%22%3A%7B%22html%22%3Atrue%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22html%22%7D%7D