mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Remove filterTokens helper (now used only by tests).
This commit is contained in:
parent
2b8369ae39
commit
55729cfcf7
5 changed files with 21 additions and 61 deletions
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { filterTokens } = require("../../helpers");
|
||||
const { parse, printParseErrorCode } = require("jsonc-parser");
|
||||
|
||||
/** @type import("../../lib/markdownlint").Rule */
|
||||
|
|
@ -13,7 +12,9 @@ module.exports = {
|
|||
"parser": "markdownit",
|
||||
"asynchronous": true,
|
||||
"function": (params, onError) => {
|
||||
filterTokens(params, "fence", (fence) => {
|
||||
const fences = params.parsers.markdownit.tokens.
|
||||
filter((token => token.type === "fence"));
|
||||
for (const fence of fences) {
|
||||
if (/jsonc?/i.test(fence.info)) {
|
||||
const errors = [];
|
||||
parse(fence.content, errors);
|
||||
|
|
@ -28,6 +29,6 @@ module.exports = {
|
|||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue