Reimplement MD034/no-bare-urls using micromark tokens (fixes #707).

This commit is contained in:
David Anson 2023-02-05 16:58:06 -08:00
parent 64159fa456
commit b990b3ea77
22 changed files with 1495 additions and 947 deletions

View file

@ -816,12 +816,14 @@ function getReferenceLinkImageData(params) {
const filteredTokens =
micromark.filterByTypes(
params.parsers.micromark.tokens,
// definitionLineIndices
"definition", "gfmFootnoteDefinition",
// definitions and definitionLineIndices
"definitionLabelString", "gfmFootnoteDefinitionLabelString",
// references and shortcuts
"gfmFootnoteCall", "image", "link"
[
// definitionLineIndices
"definition", "gfmFootnoteDefinition",
// definitions and definitionLineIndices
"definitionLabelString", "gfmFootnoteDefinitionLabelString",
// references and shortcuts
"gfmFootnoteCall", "image", "link"
]
);
for (const token of filteredTokens) {
let labelPrefix = "";