mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Change HTML comment content sanitization to avoid breaking list item indent, respect table cell content rules (fixes #563).
This commit is contained in:
parent
7f8962c882
commit
f0bb4c639b
8 changed files with 593 additions and 63 deletions
|
|
@ -57,17 +57,17 @@ test("clearHtmlCommentTextValid", (t) => {
|
|||
"<!-->",
|
||||
"<!--->",
|
||||
"<!---->",
|
||||
"<!--.........-->",
|
||||
" <!--.........-->",
|
||||
" <!--.........-->",
|
||||
"<!--......-->",
|
||||
"<!--....-->",
|
||||
"<!--.-->",
|
||||
"<!-- ....... -->",
|
||||
" <!-- ....... -->",
|
||||
" <!-- ....... -->",
|
||||
"<!-- .... -->",
|
||||
"<!--....-->",
|
||||
"<!-- -->",
|
||||
"<!-- .. -->",
|
||||
"<!---->",
|
||||
"<!--.....-->",
|
||||
"<!--.........-->",
|
||||
"<!--..-->",
|
||||
"<!--. -->",
|
||||
"<!--",
|
||||
"-->",
|
||||
"<!--",
|
||||
|
|
@ -79,7 +79,7 @@ test("clearHtmlCommentTextValid", (t) => {
|
|||
"-->",
|
||||
"<!--",
|
||||
"",
|
||||
"......",
|
||||
" .....",
|
||||
"",
|
||||
"-->",
|
||||
"<!--....",
|
||||
|
|
@ -93,7 +93,7 @@ test("clearHtmlCommentTextValid", (t) => {
|
|||
"-->text",
|
||||
"<!--....--><!--....-->",
|
||||
"text<!--....-->text<!--....-->text",
|
||||
"text<!--..............-->text",
|
||||
"text<!--.... . .... ..-->text",
|
||||
"<!--",
|
||||
"text"
|
||||
];
|
||||
|
|
@ -118,7 +118,7 @@ test("clearHtmlCommentTextInvalid", (t) => {
|
|||
"<!--->-->",
|
||||
"<!--->t-->",
|
||||
"<!---->t-->",
|
||||
" <!-- indented code block -->"
|
||||
" <!-- ........ .... ..... -->"
|
||||
];
|
||||
const actual = helpers.clearHtmlCommentText(invalidComments.join("\n"));
|
||||
const expected = invalidComments.join("\n");
|
||||
|
|
@ -134,8 +134,8 @@ test("clearHtmlCommentTextNonGreedy", (t) => {
|
|||
"<!----> -->"
|
||||
];
|
||||
const nonGreedyResult = [
|
||||
"<!--......--> -->",
|
||||
"<!--......--> -->",
|
||||
"<!-- .... --> -->",
|
||||
"<!--..... --> -->",
|
||||
"<!--.--> -->",
|
||||
"<!----> -->"
|
||||
];
|
||||
|
|
@ -155,9 +155,9 @@ test("clearHtmlCommentTextEmbedded", (t) => {
|
|||
];
|
||||
const embeddedResult = [
|
||||
"text<!--....-->text",
|
||||
"<!--............................-->",
|
||||
"<!-- .................... ..... -->",
|
||||
"text<!--....-->text",
|
||||
"text<!--............................-->text",
|
||||
"text<!-- .................... ..... -->text",
|
||||
"text<!--....-->text"
|
||||
];
|
||||
const actual = helpers.clearHtmlCommentText(embeddedComments.join("\n"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue