mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Exclude htmlFlow content by default for filterByTypes, opt in as needed.
This commit is contained in:
parent
ea9659841e
commit
12502f6571
18 changed files with 206 additions and 129 deletions
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
const { addErrorDetailIf, blockquotePrefixRe, isBlankLine } =
|
||||
require("../helpers");
|
||||
const { filterByTypes, getHeadingLevel, inHtmlFlow } =
|
||||
require("../helpers/micromark.cjs");
|
||||
const { filterByTypes, getHeadingLevel } = require("../helpers/micromark.cjs");
|
||||
|
||||
const defaultLines = 1;
|
||||
|
||||
|
|
@ -50,7 +49,7 @@ module.exports = {
|
|||
const headings = filterByTypes(
|
||||
micromarkTokens,
|
||||
[ "atxHeading", "setextHeading" ]
|
||||
).filter((heading) => !inHtmlFlow(heading));
|
||||
);
|
||||
for (const heading of headings) {
|
||||
const { startLine, endLine } = heading;
|
||||
const line = lines[startLine - 1].trim();
|
||||
|
|
@ -73,7 +72,7 @@ module.exports = {
|
|||
actualAbove,
|
||||
"Above",
|
||||
line,
|
||||
null,
|
||||
undefined,
|
||||
{
|
||||
"insertText": getBlockQuote(
|
||||
lines[startLine - 2],
|
||||
|
|
@ -101,7 +100,7 @@ module.exports = {
|
|||
actualBelow,
|
||||
"Below",
|
||||
line,
|
||||
null,
|
||||
undefined,
|
||||
{
|
||||
"lineNumber": endLine + 1,
|
||||
"insertText": getBlockQuote(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue