Refactor to remove forEachLine and getLineMetadata helpers, reimplement MD012/MD018/MD020/MD031 using micromark tokens.

This commit is contained in:
David Anson 2024-08-17 17:58:16 -07:00
parent 7efc2605b1
commit c8fd9eb4b3
13 changed files with 198 additions and 308 deletions

View file

@ -594,15 +594,12 @@ function lintContent(
"lines": Object.freeze(lines),
"frontMatterLines": Object.freeze(frontMatterLines)
};
const lineMetadata =
helpers.getLineMetadata(paramsBase);
const flattenedLists =
helpers.flattenLists(markdownitTokens);
const referenceLinkImageData =
helpers.getReferenceLinkImageData(micromarkTokens);
cache.set({
flattenedLists,
lineMetadata,
referenceLinkImageData
});
// Function to run for each rule