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

@ -14772,6 +14772,40 @@ Generated by [AVA](https://avajs.dev).
`,
}
## headings-with-emoji.md
> Snapshot 1
{
errors: [],
fixed: `# headings-with-emoji␊
## Known Issues :bug:␊
## Love :heartpulse:␊
## :tada:␊
## :checkered_flag:␊
## :clock930:␊
## :t-rex:␊
## Boba:bubble_tea:␊
<!-- markdownlint-disable heading-style -->
## Fix the :bug: ##␊
Another :heartpulse:␊
--------------------␊
:eyes:␊
------␊
`,
}
## headings-with-html-entities.md
> Snapshot 1
@ -14789,7 +14823,7 @@ Generated by [AVA](https://avajs.dev).
deleteCount: 1,
editColumn: 31,
},
lineNumber: 22,
lineNumber: 24,
ruleDescription: 'Trailing punctuation in heading',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md',
ruleNames: [
@ -14808,7 +14842,7 @@ Generated by [AVA](https://avajs.dev).
deleteCount: 1,
editColumn: 34,
},
lineNumber: 24,
lineNumber: 26,
ruleDescription: 'Trailing punctuation in heading',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md',
ruleNames: [
@ -14827,7 +14861,7 @@ Generated by [AVA](https://avajs.dev).
deleteCount: 1,
editColumn: 31,
},
lineNumber: 26,
lineNumber: 28,
ruleDescription: 'Trailing punctuation in heading',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md026.md',
ruleNames: [
@ -14850,6 +14884,8 @@ Generated by [AVA](https://avajs.dev).
## Copyright 2004 &#x000A9;
## Copyright 2004 &#X000A9;
## Copyright 2005 &#169;
## Copyright 2006 &#169; ##␊