-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Description
marked is incompatible with Safari on iOS/iPadOS prior to 16.5 due to a SyntaxError.
The issue stems from two instances of RegExp negative lookbehind assertions (?<!...) within the blockSkip constant.
These appear to be the only instances of this incompatible syntax in the entire codebase. Because the issue is isolated to this single constant, a targeted fix could restore compatibility for a large number of users.
The problematic lines are within the link and code replacements:
const blockSkip = edit(/link|code|html/, 'g')
.replace('link', /\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:...)\)/) // <-- OFFENSE #1
.replace('code', /(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/) // <-- OFFENSE #2
.replace('html', /<(?! )[^<>]*?>/)
.getRegex();Thank you for your consideration and for maintaining this library.
pmartin7, noahw3, allezxandre and sergeushenecz
Metadata
Metadata
Assignees
Labels
No labels