mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-20 16: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
|
|
@ -22,7 +22,7 @@ module.exports = {
|
|||
for (const [ lineIndex, line ] of lines.entries()) {
|
||||
if (!ignoreBlockLineNumbers.has(lineIndex + 1)) {
|
||||
const match =
|
||||
/^(#+)([ \t]*)([^#]*?[^#\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line);
|
||||
/^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line);
|
||||
if (match) {
|
||||
const [
|
||||
,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue