mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Update all references to "params.tokens" to "params.parsers.markdownit.tokens" for clarity.
This commit is contained in:
parent
5302ee45de
commit
4b27bac79b
15 changed files with 45 additions and 37 deletions
|
|
@ -579,7 +579,7 @@ function lintContent(
|
|||
const codeBlockAndSpanRanges =
|
||||
helpers.codeBlockAndSpanRanges(paramsBase, lineMetadata);
|
||||
const flattenedLists =
|
||||
helpers.flattenLists(paramsBase.tokens);
|
||||
helpers.flattenLists(paramsBase.parsers.markdownit.tokens);
|
||||
const htmlElementRanges =
|
||||
helpers.htmlElementRanges(paramsBase, lineMetadata);
|
||||
const referenceLinkImageData =
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
"function": function MD002(params, onError) {
|
||||
const level = Number(params.config.level || 1);
|
||||
const tag = "h" + level;
|
||||
params.tokens.every(function forToken(token) {
|
||||
params.parsers.markdownit.tokens.every(function forToken(token) {
|
||||
if (token.type === "heading_open") {
|
||||
addErrorDetailIf(onError, token.lineNumber, tag, token.tag);
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ module.exports = {
|
|||
"function": function MD027(params, onError) {
|
||||
let blockquoteNesting = 0;
|
||||
let listItemNesting = 0;
|
||||
for (const token of params.tokens) {
|
||||
for (const token of params.parsers.markdownit.tokens) {
|
||||
const { content, lineNumber, type } = token;
|
||||
if (type === "blockquote_open") {
|
||||
blockquoteNesting++;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
"function": function MD028(params, onError) {
|
||||
let prevToken = {};
|
||||
let prevLineNumber = null;
|
||||
for (const token of params.tokens) {
|
||||
for (const token of params.parsers.markdownit.tokens) {
|
||||
if ((token.type === "blockquote_open") &&
|
||||
(prevToken.type === "blockquote_close")) {
|
||||
for (
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ module.exports = {
|
|||
return base;
|
||||
}
|
||||
let state = base;
|
||||
for (const token of params.tokens) {
|
||||
for (const token of params.parsers.markdownit.tokens) {
|
||||
state = state(token);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ module.exports = {
|
|||
);
|
||||
if (!foundFrontMatterTitle) {
|
||||
const htmlHeadingRe = new RegExp(`^<h${level}[ />]`, "i");
|
||||
params.tokens.every((token) => {
|
||||
params.parsers.markdownit.tokens.every((token) => {
|
||||
let isError = false;
|
||||
if (token.type === "html_block") {
|
||||
if (token.content.startsWith("<!--")) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ module.exports = {
|
|||
"tags": [ "code" ],
|
||||
"function": function MD046(params, onError) {
|
||||
let expectedStyle = String(params.config.style || "consistent");
|
||||
const codeBlocksAndFences = params.tokens.filter(
|
||||
const codeBlocksAndFences = params.parsers.markdownit.tokens.filter(
|
||||
(token) => (token.type === "code_block") || (token.type === "fence")
|
||||
);
|
||||
for (const token of codeBlocksAndFences) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@ module.exports = {
|
|||
"function": function MD048(params, onError) {
|
||||
const style = String(params.config.style || "consistent");
|
||||
let expectedStyle = style;
|
||||
const fenceTokens = params.tokens.filter((token) => token.type === "fence");
|
||||
const fenceTokens = params.parsers.markdownit.tokens.filter(
|
||||
(token) => token.type === "fence"
|
||||
);
|
||||
for (const fenceToken of fenceTokens) {
|
||||
const { lineNumber, markup } = fenceToken;
|
||||
if (expectedStyle === "consistent") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue