mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Reimplement MD026/no-trailing-punctuation using micromark tokens, ignore trailing GitHub emoji codes, improve tests (fixes #457).
This commit is contained in:
parent
272c15ed39
commit
c06506c317
9 changed files with 157 additions and 32 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue