mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +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
|
|
@ -50,11 +50,11 @@ module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
|
|||
// Regular expression for all instances of emphasis markers
|
||||
var emphasisMarkersRe = /[_*]/g;
|
||||
// Regular expression for inline links and shortcut reference links
|
||||
var linkRe = /(?:|(?<![^[]))(\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\])(\([^)]*\)|\[[^\]]*\])?/g;
|
||||
var linkRe = /(\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\])(\([^)]*\)|\[[^\]]*\])?/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.*$/;
|
||||
// All punctuation characters (normal and full-width)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue