Change comment replacement character from " " (with trailing "\") to "." to avoid creating indented code blocks.

This commit is contained in:
David Anson 2021-01-30 14:36:11 -08:00
parent c4e236b858
commit c7d2416f95
4 changed files with 45 additions and 36 deletions

View file

@ -56,17 +56,17 @@ test("clearHtmlCommentTextValid", (t) => {
"<!-->",
"<!--->",
"<!---->",
"<!-- -->",
" <!-- -->",
" <!-- -->",
"<!-- -->",
"<!-- -->",
"<!-- -->",
"<!-- -->",
"<!--.........-->",
" <!--.........-->",
" <!--.........-->",
"<!--......-->",
"<!--....-->",
"<!--.-->",
"<!--....-->",
"<!---->",
"<!-- -->",
"<!-- -->",
"<!-- -->",
"<!--.....-->",
"<!--.........-->",
"<!--..-->",
"<!--",
"-->",
"<!--",
@ -78,21 +78,21 @@ test("clearHtmlCommentTextValid", (t) => {
"-->",
"<!--",
"",
" \\",
"......",
"",
"-->",
"<!-- \\",
"<!--....",
"",
" -->",
"text<!-- -->text",
"....-->",
"text<!--....-->text",
"text<!--",
"-->text",
"text<!--",
" \\",
"....",
"-->text",
"<!-- --><!-- -->",
"text<!-- -->text<!-- -->text",
"text<!-- -->text",
"<!--....--><!--....-->",
"text<!--....-->text<!--....-->text",
"text<!--..............-->text",
"<!--",
"text"
];
@ -133,9 +133,9 @@ test("clearHtmlCommentTextNonGreedy", (t) => {
"<!----> -->"
];
const nonGreedyResult = [
"<!-- --> -->",
"<!-- --> -->",
"<!-- --> -->",
"<!--......--> -->",
"<!--......--> -->",
"<!--.--> -->",
"<!----> -->"
];
const actual = helpers.clearHtmlCommentText(nonGreedyComments.join("\n"));
@ -153,11 +153,11 @@ test("clearHtmlCommentTextEmbedded", (t) => {
"text<!--text-->text"
];
const embeddedResult = [
"text<!-- -->text",
"text<!--....-->text",
"<!-- markdownlint-disable MD010 -->",
"text<!-- -->text",
"text<!--....-->text",
"text<!-- markdownlint-disable MD010 -->text",
"text<!-- -->text"
"text<!--....-->text"
];
const actual = helpers.clearHtmlCommentText(embeddedComments.join("\n"));
const expected = embeddedResult.join("\n");