// @ts-check "use strict"; const os = require("node:os"); const path = require("node:path"); const test = require("ava").default; const helpers = require("../helpers"); const { markdownlint } = require("../lib/markdownlint").promises; test("clearHtmlCommentTextValid", (t) => { t.plan(1); const validComments = [ "", "", "", "", " ", " ", "", "", "", "", "", "", "", "", "", "", "", "", "", "texttext", "texttext", "texttext", "", "texttexttext", "texttext", "", "", "", "", " ", " ", "", "", "", "", "", "", "", "", "", "", "", "", "", "texttext", "texttext", "texttext", "", "texttexttext", "texttext", "", "", " -->", "text-->", "text-->", "", "-->", "t-->", "-->", "t-->", "t-->", " " ]; const actual = helpers.clearHtmlCommentText(invalidComments.join("\n")); const expected = invalidComments.join("\n"); t.is(actual, expected); }); test("clearHtmlCommentTextNonGreedy", (t) => { t.plan(1); const nonGreedyComments = [ " -->", " -->", " -->", " -->" ]; const nonGreedyResult = [ " -->", " -->", " -->", " -->" ]; const actual = helpers.clearHtmlCommentText(nonGreedyComments.join("\n")); const expected = nonGreedyResult.join("\n"); t.is(actual, expected); }); test("clearHtmlCommentTextEmbedded", (t) => { t.plan(1); const embeddedComments = [ "texttext", "", "texttext", "texttext", "texttext" ]; const embeddedResult = [ "texttext", "", "texttext", "texttext", "texttext" ]; const actual = helpers.clearHtmlCommentText(embeddedComments.join("\n")); const expected = embeddedResult.join("\n"); t.is(actual, expected); }); test("isBlankLine", (t) => { t.plan(33); // @ts-ignore t.true(helpers.isBlankLine(null), "[null]"); const blankLines = [ "", " ", " ", "\t\t\t", "\r", "\n", "\t\r\n", " ", "", "", "\t", ">", "> ", "> > > \t", "> ", ">>", " ", "-->", "text --> --> text", "text ", "text text", "text --> text --> text