Open just-another-jxliu opened 2 years ago
Hey @just-another-jxliu, thanks for reporting this!
I'm going to roll back the latest release until we get this solved.
@msglifeIberia and or @MSGInsurIt, would you be interested in revisiting PR #254 to see if we could make it work with Safari?
For context, the issue is that the RegEx above uses a Negative lookbehind assertion which is the (?<!
part. Safari doesn't support this.
Here's a minimum reproducible test case:
let regEx = /(?<!y)x/
Hi,
We are not finding a quick solution for this issue without Negative lookbehind support without doing considerable code changes. For now, we would like to propose keeping the fix for the browsers that support it and having a fallback mechanism for those that don't support.
FYI @just-another-jxliu , The solution might also come from the browser. https://bugs.webkit.org/show_bug.cgi?id=174931
Hi @sstur,
The issue with the RegExp lookbehind assertions was finally implemented in the safari browser as mentioned in the following link: https://bugs.webkit.org/show_bug.cgi?id=174931
It would make sense to re-apply the merge https://github.com/sstur/draft-js-utils/pull/254 to the latest version.
Will you merge the code again?
Negative lookbehind assertion It's working now in Release 161 of Safari Technology Preview, downloads are here: [https://developer.apple.com/safari/resources/]
Although it didn't make the cut for the release notes!
Update to italic parsing breaks Safari 15.5:
em: /^_([\s\S]+?)(?<!\\)_|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/
SyntaxError: Invalid regular expression: invalid group specifier name
https://github.com/sstur/draft-js-utils/pull/254