Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Error in Safari due to lookbehind assertion used in regex #44

Closed
daks01 opened this issue Aug 29, 2022 · 9 comments
Closed

Error in Safari due to lookbehind assertion used in regex #44

daks01 opened this issue Aug 29, 2022 · 9 comments
Labels

Comments

@daks01
Copy link

daks01 commented Aug 29, 2022

lookbehind assertion is not supported in Safari:

a few years ago there was a similar Issue (closed now)

but still no babel plugin or corejs polyfill appeared

can you simulate lookbehind like this?

@sapegin
Copy link
Owner

sapegin commented Aug 29, 2022

Feel free to submit a pull request with a fix 👾

@daks01
Copy link
Author

daks01 commented Aug 30, 2022

can you explain what this regex do?
it may be possible to write it without lookbehind assertion...
https://github.com/sapegin/richtypo.js/blob/master/packages/richtypo/src/richtypo.js#L6

upd: demo

@sapegin
Copy link
Owner

sapegin commented Aug 30, 2022

It catches all Markdown images and links, so we could exclude them from processing and readd at the end:

![Foo](http://bar)
[Foo](http://bar)

@daks01
Copy link
Author

daks01 commented Aug 30, 2022

regex without lookbehind
https://extendsclass.com/regex/55c66ae

daks01 added a commit to daks01/richtypo.js that referenced this issue Aug 30, 2022
@sapegin
Copy link
Owner

sapegin commented Aug 30, 2022

We could try that, thanks!

@xpuu
Copy link

xpuu commented Jan 16, 2023

Oh, now I see. There's not just one regexp with lookbehind, but plenty of them. :(

@daks01
Copy link
Author

daks01 commented Jan 16, 2023

Oh, now I see. There's not just one regexp with lookbehind, but plenty of them. :(

yep,(

@xpuu
Copy link

xpuu commented Jan 16, 2023

Hopefully lookbehind support in webkit should be released soon. 🙄

Joel Bruner 2023-01-13 11:50:22 PST
It's working now in Release 161 of Safari Technology Preview

@daks01
Copy link
Author

daks01 commented Jan 16, 2023

xpuu
i came across several ways to emulate lookbehind in older browsers
https://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript

maybe I will return to this issue in a month
who knows

@sapegin sapegin added the bug label Sep 14, 2023
Repository owner locked and limited conversation to collaborators Sep 14, 2023
@sapegin sapegin converted this issue into discussion #64 Sep 14, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

3 participants