mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update clearHtmlCommentText helper to match HTML specification better; "--" within a comment does not make it invalid (fixes #361).
This commit is contained in:
parent
df4aa9f4e8
commit
838afe0a00
4 changed files with 37 additions and 21 deletions
|
|
@ -12,6 +12,7 @@ test("clearHtmlCommentTextValid", (t) => {
|
|||
"<!-- text -->",
|
||||
"<!--text-->",
|
||||
"<!-- -->",
|
||||
"<!-- -- -->",
|
||||
"<!---->",
|
||||
"<!---text-->",
|
||||
"<!--text-text-->",
|
||||
|
|
@ -49,6 +50,7 @@ test("clearHtmlCommentTextValid", (t) => {
|
|||
"<!-- -->",
|
||||
"<!-- -->",
|
||||
"<!-- -->",
|
||||
"<!-- -->",
|
||||
"<!---->",
|
||||
"<!-- -->",
|
||||
"<!-- -->",
|
||||
|
|
@ -94,18 +96,26 @@ test("clearHtmlCommentTextInvalid", (t) => {
|
|||
"<!->",
|
||||
"<!-->",
|
||||
"<!--->",
|
||||
"<!-->-->",
|
||||
"<!--->-->",
|
||||
"<!----->",
|
||||
"<!------>",
|
||||
"<!-- -- -->",
|
||||
"<!-->-->",
|
||||
"<!--> -->",
|
||||
"<!--->-->",
|
||||
"<!-->text-->",
|
||||
"<!--->text-->",
|
||||
"<!--text--->",
|
||||
"<!--te--xt-->"
|
||||
"<!---->",
|
||||
// Restrictions from specification
|
||||
"<!-->-->",
|
||||
"<!-->t-->",
|
||||
"<!--->-->",
|
||||
"<!--->t-->",
|
||||
"<!--<!--t-->",
|
||||
"<!--t<!---->",
|
||||
"<!--t<!--t-->",
|
||||
// "<!---->t-->",
|
||||
// "<!--t-->-->",
|
||||
// "<!--t-->t-->",
|
||||
"<!----!>t-->",
|
||||
"<!--t--!>-->",
|
||||
"<!--t--!>t-->",
|
||||
"<!--<!--->",
|
||||
"<!--t<!--->"
|
||||
];
|
||||
const actual = helpers.clearHtmlCommentText(invalidComments.join("\n"));
|
||||
const expected = invalidComments.join("\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue