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

Regular expression are not support on Mac Safari and iPadOS and iOS Chrome and Safari Browser #4

Open
phyozawtun opened this issue Nov 16, 2020 · 7 comments

Comments

@phyozawtun
Copy link

phyozawtun commented Nov 16, 2020

Issue
This Sylbreak is simple, easy to use, and really awesome. But one thing while I am using this on my project it is not working on Mac Safari, Safari, and Chrome of iOS and iPad OS. After few research I find out look-behind assertions ((?<= ) and (?<! )) are not support on these browser.

My fix
As I am not very expert at "regular expression" I tried my best to fix the solution. Not sure it was right way but working on my device. Hope this bug report and suggested solution would be help.

//Original
const BREAK_PATTERN = new RegExp("((?<!" + ssSymbol + ")[" + myConsonant + "](?![" + aThat + ssSymbol + "])" + "|[" + enChar + otherChar + "])", "mg");
//My Fix
const BREAK_PATTERN = new RegExp("((?!" + ssSymbol + ")[" + myConsonant + "](?![" + aThat + ssSymbol + "])" + "|[" + enChar + otherChar + "])", "mg");

image

Reference https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Browser_compatibility

@ye-kyaw-thu
Copy link
Owner

ye-kyaw-thu commented Nov 21, 2020 via email

@phyozawtun
Copy link
Author

Dear Ko Ye,

Sorry for delay reply.
I have tested and try my best on မြန်မာ၊ ပါဠိ၊ ရှမ်း၊ ကရင် languages.
Also testd on major devices.
Your script works well on all these languages and all devices.
I have used your algorithm on follow project. You can check and check also.

https://phyozawtun.github.io/myanmar-lorem-ipsum/

Best regards,
Phyo Zaw Tun

@ye-kyaw-thu
Copy link
Owner

ye-kyaw-thu commented Apr 28, 2021 via email

@chanmratekoko
Copy link
Contributor

@phyozawtun

ကို ဖြိုးဇော်ထွန်း ခင်ဗျ
Javascript regular expression ရဲ့ Bug ကို Fix လုပ်ထားလိုက်ပါပြီ
Issue Report ပေးတဲ့အတွက် ကျေးဇူးပါခင်ဗျ
တလက်စတည်း PHP အတွက်လည်း Marge Request လုပ်ထားပါတယ်

@phyozawtun
Copy link
Author

I have not yet seen, marge request for PHP. Can I know, where can I check?

@chanmratekoko
Copy link
Contributor

@phyozawtun
Copy link
Author

ဟုတ်လုပ်ထားမယ် အစ်ကို

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