Update definition of helpers.isBlankLine to treat unterminated start/end comments as potentially blank lines (fixes #431).

This commit is contained in:
David Anson 2021-12-20 04:18:45 +00:00 committed by GitHub
parent 1b23976aa2
commit 6dea67825a
4 changed files with 67 additions and 11 deletions

View file

@ -0,0 +1,38 @@
# Lists with Commented Items
Text
- item <!-- comment -->
- item <!-- comment -->
<!--
- commented subitem: description
- commented subitem: description
-->
- item <!-- comment -->
- item <!-- comment -->
Text
- item <!-- comment -->
- item <!-- comment -->
<!-- - commented subitem: description
- commented subitem: description -->
- item <!-- comment -->
- item <!-- comment -->
Text
- item <!-- comment -->
<!-- - commented subitem: description -->
- item <!-- comment -->
Text
- item <!-- comment -->
- item <!-- comment -->
<!-- - commented subitem: description -->
<!-- - commented subitem: description -->
- item <!-- comment -->
- item <!-- comment -->
Text

View file

@ -226,7 +226,7 @@ bar`
});
test("isBlankLine", (t) => {
t.plan(25);
t.plan(29);
const blankLines = [
null,
"",
@ -244,7 +244,11 @@ test("isBlankLine", (t) => {
"> ",
"> > > \t",
"> <!--text-->",
">><!--text-->"
">><!--text-->",
"<!--",
" <!-- text",
"text --> ",
"-->"
];
blankLines.forEach((line) => t.true(helpers.isBlankLine(line), line || ""));
const nonBlankLines = [
@ -253,9 +257,9 @@ test("isBlankLine", (t) => {
".",
"> .",
"<!--text--> text",
"<!--->",
"<!--",
"-->"
"text <!--text-->",
"text <!--",
"--> text"
];
nonBlankLines.forEach((line) => t.true(!helpers.isBlankLine(line), line));
});