mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 14:30:12 +01:00
Reimplement MD041/first-line-heading/first-line-h1 using micromark tokens.
This commit is contained in:
parent
0f5e65abd4
commit
a83e2d8a09
4 changed files with 94 additions and 80 deletions
14
lib/md032.js
14
lib/md032.js
|
|
@ -2,19 +2,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addErrorContext, blockquotePrefixRe, isBlankLine } =
|
||||
require("../helpers");
|
||||
const { filterByPredicate } = require("../helpers/micromark.cjs");
|
||||
const { addErrorContext, blockquotePrefixRe, isBlankLine } = require("../helpers");
|
||||
const { filterByPredicate, nonContentTokens } = require("../helpers/micromark.cjs");
|
||||
|
||||
const nonContentTokens = new Set([
|
||||
"blockQuoteMarker",
|
||||
"blockQuotePrefix",
|
||||
"blockQuotePrefixWhitespace",
|
||||
"lineEnding",
|
||||
"lineEndingBlank",
|
||||
"linePrefix",
|
||||
"listItemIndent"
|
||||
]);
|
||||
const isList = (token) => (
|
||||
(token.type === "listOrdered") || (token.type === "listUnordered")
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue