Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to italic parsing breaks Safari 15.5 #255

Open
just-another-jxliu opened this issue Jun 11, 2022 · 6 comments
Open

Update to italic parsing breaks Safari 15.5 #255

just-another-jxliu opened this issue Jun 11, 2022 · 6 comments

Comments

@just-another-jxliu
Copy link

Update to italic parsing breaks Safari 15.5: em: /^_([\s\S]+?)(?<!\\)_|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/
SyntaxError: Invalid regular expression: invalid group specifier name

#254

@sstur
Copy link
Owner

sstur commented Jun 11, 2022

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?

@sstur
Copy link
Owner

sstur commented Jun 11, 2022

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/

image

@MSGInsurIt
Copy link
Contributor

MSGInsurIt commented Jun 21, 2022

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.

@MSGInsurIt
Copy link
Contributor

FYI @just-another-jxliu ,
The solution might also come from the browser.
https://bugs.webkit.org/show_bug.cgi?id=174931

@MSGInsurIt
Copy link
Contributor

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 #254 to the latest version.

Will you merge the code again?

@MSGInsurIt
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants