mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-28 11:38:48 +01:00
Refactor to remove micromark helper getTokenTextByType, update getDescendantsByType to allow sub-arrays.
This commit is contained in:
parent
0f210d5c1a
commit
8cbbed8e79
7 changed files with 44 additions and 94 deletions
|
|
@ -25,11 +25,7 @@ module.exports = {
|
|||
const reference = getDescendantsByType(link, [ "reference" ]);
|
||||
const resource = getDescendantsByType(link, [ "resource" ]);
|
||||
const referenceString = getDescendantsByType(reference, [ "referenceString" ]);
|
||||
const resourceDestination = getDescendantsByType(resource, [ "resourceDestination" ]);
|
||||
const resourceDestinationString = [
|
||||
...getDescendantsByType(resourceDestination, [ "resourceDestinationRaw", "resourceDestinationString" ]),
|
||||
...getDescendantsByType(resourceDestination, [ "resourceDestinationLiteral", "resourceDestinationString" ])
|
||||
];
|
||||
const resourceDestinationString = getDescendantsByType(resource, [ "resourceDestination", [ "resourceDestinationLiteral", "resourceDestinationRaw" ], "resourceDestinationString" ]);
|
||||
const hasLabelText = labelText.length > 0;
|
||||
const hasReference = reference.length > 0;
|
||||
const hasResource = resource.length > 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue