Reimplement MD026/no-trailing-punctuation using micromark tokens, ignore trailing GitHub emoji codes, improve tests (fixes #457).

This commit is contained in:
David Anson 2023-06-24 15:45:51 -07:00
parent 272c15ed39
commit c06506c317
9 changed files with 157 additions and 32 deletions

View file

@ -1283,3 +1283,21 @@ Empty bracket pairs: [text3[]][]
};
return markdownlint(options).then(() => null);
});
test("endOfLineHtmlEntityRe", async(t) => {
const { characterEntities } = await import("character-entities");
const entities = Object.keys(characterEntities);
t.plan(entities.length);
for (const entity of entities) {
t.true(helpers.endOfLineHtmlEntityRe.test(`-&${entity};`), entity);
}
});
test("endOfLineGemojiCodeRe", async(t) => {
const { gemoji } = await import("gemoji");
const emojis = gemoji.flatMap((i) => i.names);
t.plan(emojis.length);
for (const emoji of emojis) {
t.true(helpers.endOfLineGemojiCodeRe.test(`-:${emoji}:`), emoji);
}
});