Reimplement MD039/no-space-in-links using micromark tokens.

This commit is contained in:
David Anson 2024-08-03 17:39:30 -07:00
parent 92a19b6f36
commit daa155d5a1
6 changed files with 265 additions and 124 deletions

View file

@ -1104,20 +1104,13 @@ test("someCustomRulesHaveValidUrl", (t) => {
});
test("markdownItPluginsSingle", (t) => new Promise((resolve) => {
t.plan(2);
t.plan(4);
markdownlint({
"strings": {
"string": "# Heading\n\nText [ link ](https://example.com)\n"
"string": "# Heading\n\nText\n"
},
"markdownItPlugins": [
[
pluginInline,
"trim_text_plugin",
"text",
function iterator(tokens, index) {
tokens[index].content = tokens[index].content.trim();
}
]
[ pluginInline, "check_text_plugin", "text", () => t.true(true) ]
]
}, function callback(err, actual) {
t.falsy(err);