mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Fix an instance of "Polynomial regular expression used on uncontrolled data".
This commit is contained in:
parent
a4c4e198d6
commit
b6121341b9
2 changed files with 2 additions and 2 deletions
|
@ -2979,7 +2979,7 @@ module.exports = {
|
|||
var trailingPunctuationRe = new RegExp("\\s*[" + escapeForRegExp(punctuation) + "]+$");
|
||||
forEachHeading(params, function (heading) {
|
||||
var line = heading.line, lineNumber = heading.lineNumber;
|
||||
var trimmedLine = line.replace(/[\s#]*$/, "");
|
||||
var trimmedLine = line.replace(/([^\s#])[\s#]+$/, "$1");
|
||||
var match = trailingPunctuationRe.exec(trimmedLine);
|
||||
if (match && !endOfLineHtmlEntityRe.test(trimmedLine)) {
|
||||
var fullMatch = match[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue