mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Refactor RegExps to avoid the possibility of polynomial backtracking (fixes #657).
This commit is contained in:
parent
9b1840a5a4
commit
e0219411c6
8 changed files with 14 additions and 16 deletions
|
|
@ -1034,8 +1034,7 @@ test("validateConfigExampleJson", (t) => {
|
|||
const ajv = new Ajv(ajvOptions);
|
||||
const validateSchema = ajv.compile(configSchema);
|
||||
t.is(
|
||||
// eslint-disable-next-line regexp/optimal-quantifier-concatenation
|
||||
configSchema.$id.replace(/^.*v(?<ver>\d+\.\d+\.\d+).*$/u, "$<ver>"),
|
||||
configSchema.$id.replace(/^.*\/v(?<ver>\d+\.\d+\.\d+)\/.*$/u, "$<ver>"),
|
||||
version
|
||||
);
|
||||
t.is(configSchema.$id, configSchema.properties.$schema.default);
|
||||
|
|
@ -1081,7 +1080,7 @@ test("allBuiltInRulesHaveValidUrl", (t) => {
|
|||
});
|
||||
|
||||
test("someCustomRulesHaveValidUrl", (t) => {
|
||||
t.plan(8);
|
||||
t.plan(9);
|
||||
for (const rule of customRules.all) {
|
||||
t.true(!rule.information ||
|
||||
(Object.getPrototypeOf(rule.information) === URL.prototype));
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"use strict";
|
||||
|
||||
const anyBlockquote = require("./any-blockquote");
|
||||
module.exports.anyBlockquote = anyBlockquote;
|
||||
module.exports.anyBlockquote = anyBlockquote[1];
|
||||
|
||||
const everyNLines = require("./every-n-lines");
|
||||
module.exports.everyNLines = everyNLines;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue