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,7 +3,7 @@
"use strict";
const { addError, addErrorDetailIf } = require("../helpers");
const { filterByTypes, inHtmlFlow } = require("../helpers/micromark.cjs");
const { filterByTypes } = require("../helpers/micromark.cjs");
// eslint-disable-next-line jsdoc/valid-types
/** @type import("./markdownlint").Rule */
@ -21,7 +21,7 @@ module.exports = {
const lists = filterByTypes(
micromarkTokens,
[ "listOrdered", "listUnordered" ]
).filter((list) => !inHtmlFlow(list));
);
for (const list of lists) {
const expectedIndent = list.startColumn - 1;
let expectedEnd = 0;
@ -38,8 +38,8 @@ module.exports = {
lineNumber,
expectedIndent,
actualIndent,
null,
null,
undefined,
undefined,
range
// No fixInfo; MD007 handles this scenario better
);