mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Remove RegExp lookbehind assertions used to fix "Polynomial regular expression used on uncontrolled data" because they are not supported in Safari, add eslint-plugin-es rule no-regexp-lookbehind-assertions to prevent regressions.
This commit is contained in:
parent
f46ee0732f
commit
7c1550cbe9
5 changed files with 9 additions and 5 deletions
|
|
@ -28,12 +28,12 @@ const emphasisMarkersRe = /[_*]/g;
|
|||
|
||||
// Regular expression for inline links and shortcut reference links
|
||||
const linkRe =
|
||||
/(?:|(?<![^[]))(\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\])(\([^)]*\)|\[[^\]]*\])?/g;
|
||||
/(\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\])(\([^)]*\)|\[[^\]]*\])?/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