mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD054/link-image-style handling of url_inline to ensure link and destination match and that the destination is autolink-able (fixes #1040).
This commit is contained in:
parent
ff465262c9
commit
41bc8465d2
7 changed files with 86 additions and 2 deletions
|
|
@ -64,7 +64,14 @@ module.exports = {
|
|||
if (destination) {
|
||||
// link kind is an inline link
|
||||
const title = getTokenTextByType(descendents, "resourceTitleString");
|
||||
isError = !inline || (!urlInline && autolink && !title && !image);
|
||||
isError = !inline || (
|
||||
!urlInline &&
|
||||
autolink &&
|
||||
!image &&
|
||||
!title &&
|
||||
(label === destination) &&
|
||||
autolinkAble(destination)
|
||||
);
|
||||
} else {
|
||||
// link kind is a full/collapsed/shortcut reference link
|
||||
const isShortcut = !children.some((t) => t.type === "reference");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue