Update MD053/link-image-reference-definitions to handle references within references (i.e., Pandoc-style footnotes), verify Pandoc footnote indent is not treated as comment when markdown-it-footnote plugin is used (fixes #599).

This commit is contained in:
David Anson 2022-10-19 21:12:51 -07:00
parent 7d1fa55cc4
commit 592a42b0cb
8 changed files with 169 additions and 2 deletions

View file

@ -6,6 +6,7 @@ const fs = require("node:fs");
const path = require("node:path");
const jsYaml = require("js-yaml");
const md = require("markdown-it")();
const pluginFootnote = require("markdown-it-footnote");
const pluginInline = require("markdown-it-for-inline");
const pluginSub = require("markdown-it-sub");
const pluginSup = require("markdown-it-sup");
@ -1254,6 +1255,32 @@ test("texmath test files with texmath plugin", (t) => new Promise((resolve) => {
});
}));
test("Pandoc footnote via footnote plugin", (t) => new Promise((resolve) => {
t.plan(2);
markdownlint({
"strings": {
"string":
`# Heading
Text with: [^footnote]
[^footnote]: Footnote text on multiple
lines including a [reference][]
[reference]: https://example.com
`
},
"markdownItPlugins": [ [ pluginFootnote ] ],
"resultVersion": 0
}, (err, actual) => {
t.falsy(err);
const expected = { "string": {} };
t.deepEqual(actual, expected, "Unexpected issues.");
resolve();
});
}));
test("token-map-spans", (t) => {
t.plan(38);
const options = {