Update MD044/proper-names to parse into micromark htmlFlow tokens for better behavior when html_elements is false (fixes #832).

This commit is contained in:
David Anson 2023-05-30 20:14:02 -07:00
parent 8cb6b8eff5
commit b1eff75034
8 changed files with 386 additions and 25 deletions

View file

@ -105,6 +105,25 @@ function micromarkParse(markdown, options = {}, refsDefined = true) {
return document;
}
// /**
// * Log the structure of a Micromark token list.
// *
// * @param {Token[]} tokens Micromark tokens.
// * @param {number} depth Tree depth.
// * @returns {void}
// */
// function consoleLogTokens(tokens, depth = 0) {
// for (const token of tokens) {
// const { children, text, type } = token;
// console.log(
// `${" ".repeat(depth * 2)}${type} ${text.replace(/\n/g, "\\n")}`
// );
// if (children.length > 0) {
// consoleLogTokens(children, depth + 1);
// }
// }
// }
/**
* Filter a list of Micromark tokens by predicate.
*