mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Update MD054/link-image-style to handle autolinked email addresses when disallowed (fixes #1391).
This commit is contained in:
parent
3b07268aeb
commit
a7a50eaa39
16 changed files with 858 additions and 4 deletions
|
|
@ -51,9 +51,9 @@ module.exports = {
|
|||
let isError = false;
|
||||
if (type === "autolink") {
|
||||
// link kind is an autolink
|
||||
destination = getDescendantsByType(link, [ "autolinkProtocol" ])[0].text;
|
||||
destination = getDescendantsByType(link, [ [ "autolinkEmail", "autolinkProtocol" ] ])[0]?.text;
|
||||
label = destination;
|
||||
isError = !autolink;
|
||||
isError = !autolink && Boolean(destination);
|
||||
} else {
|
||||
// link type is "image" or "link"
|
||||
label = getDescendantsByType(link, [ "label", "labelText" ])[0].text;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue