Exclude htmlFlow content by default for filterByTypes, opt in as needed.

This commit is contained in:
David Anson 2024-06-09 17:09:03 -07:00
parent ea9659841e
commit 12502f6571
18 changed files with 206 additions and 129 deletions

View file

@ -3,8 +3,7 @@
"use strict";
const { addErrorDetailIf } = require("../helpers");
const { filterByTypes, getTokenParentOfType, inHtmlFlow } =
require("../helpers/micromark.cjs");
const { filterByTypes, getTokenParentOfType } = require("../helpers/micromark.cjs");
// eslint-disable-next-line jsdoc/valid-types
/** @type import("markdownlint-micromark").TokenType[] */
@ -57,7 +56,7 @@ module.exports = {
if (nesting >= 0) {
unorderedListNesting.set(token, nesting);
}
} else if (!inHtmlFlow(token)) {
} else {
// listItemPrefix
const nesting = unorderedListNesting.get(parent);
if (nesting !== undefined) {