Move markdown-it token manipulation code into a separate file which is only require()-ed if/when needed.

This commit is contained in:
David Anson 2024-09-14 17:33:46 -07:00
parent a65e05bff2
commit 98ff66209d
6 changed files with 384 additions and 344 deletions

View file

@ -7,6 +7,7 @@ const path = require("node:path");
const test = require("ava").default;
const helpers = require("../helpers");
const { markdownlint } = require("../lib/markdownlint").promises;
const { forEachInlineCodeSpan } = require("../lib/markdownit.cjs");
test("clearHtmlCommentTextValid", (t) => {
t.plan(1);
@ -306,7 +307,7 @@ test("forEachInlineCodeSpan", (t) => {
];
for (const testCase of testCases) {
const { input, expecteds } = testCase;
helpers.forEachInlineCodeSpan(input, (code, line, column, ticks) => {
forEachInlineCodeSpan(input, (code, line, column, ticks) => {
// @ts-ignore
const [ expectedCode, expectedLine, expectedColumn, expectedTicks ] =
expecteds.shift();