mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Fix an instance of "Polynomial regular expression used on uncontrolled data".
This commit is contained in:
parent
4b7caf2a5b
commit
96699459d1
4 changed files with 12 additions and 5 deletions
|
|
@ -30,6 +30,10 @@ const emphasisMarkersRe = /[_*]/g;
|
|||
const linkRe = /(\[(?:[^[\]]|\[[^\]]*\])*\])(\(\S*\)|\[\S*\])?/g;
|
||||
module.exports.linkRe = linkRe;
|
||||
|
||||
// Regular expression for empty inline links
|
||||
module.exports.emptyLinkRe =
|
||||
/(?:|(?<![^[]))\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\]\((?:|#|<>)\)/;
|
||||
|
||||
// Regular expression for link reference definition lines
|
||||
module.exports.linkReferenceRe = /^ {0,3}\[[^\]]+]:\s.*$/;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue