Closed donv closed 2 years ago
Ah that's unfortunate, I incorrectly assumed Safari had compatibility but it seems to be the only large browser that does not... 😕
https://caniuse.com/js-regexp-lookbehind
Do you have any suggestions for a replacement regex that works?
Regxs are tricky, but wouldn't just removing the negative lookahead work?
start = start.replace(/(.*)\[/, '$1');
There is a difference between the two:
An image is now also seen as a link, which is not correct.
I am not a regex guru at all, but would this work?
/(.*)[^!]\[/
That looks promising! So far it's been good in all my tests. I'll do a few more and then implement the new pattern. :)
@m-thielen if you want to make a PR for it I'll accept that instead.
Regular use that works in Chrome and Firefox fails with Safari. Just loading the library.
This happens at the regex at
https://github.com/Ionaru/easy-markdown-editor/blob/4d065c361e685a8b896741aa89dbe109b5338500/src/js/easymde.js#L1291
It uses a negative look ahead. I cannot see why the negative look ahead is needed. Wouldn't it just work without it?