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

v1.4.1 does not support chrome 49 #366

Open
bingcoder opened this issue May 27, 2022 · 4 comments
Open

v1.4.1 does not support chrome 49 #366

bingcoder opened this issue May 27, 2022 · 4 comments

Comments

@bingcoder
Copy link

bingcoder commented May 27, 2022

v1.4.1 add regexp /^("(?:[!#-[]-\u{10FFFF}]|\[\t -\u{10FFFF}])...$/u not support chrome 49

'idn-email': /^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u

Whether to abandon support for Chrome 49?

Thanks

@awwright
Copy link
Collaborator

@bingcoder Please provide the error.

Chrome 49 is old, I'm not sure how I would test back that far.

@ayonix
Copy link

ayonix commented Jun 29, 2022

We have the same problem, but in IE11 (Outlook unfortunately still uses IE to render add-ins in many configurations).

The error is just SyntaxError in regular expression, apparently because IE/the old Chrome don't support /u for regexes.
In the IE dev-console /1/u.test("1") has the same error as simple test.

@awwright
Copy link
Collaborator

awwright commented Jul 1, 2022

Since this is potentially an easy fix I'll take a look at it... It might be possible to rewrite this so it uses surrogate pairs.

@bingcoder @ayonix If you change it so it reads:

'idn-email': /^("(?:[!#-\[\]-\uFFFF]|\\[\t -\uFFFF])*"|[!#-'*+\-/-9=?A-Z\^-\uFFFF](?:\.?[!#-'*+\-/-9=?A-Z\^-\uFFFF])*)@([!#-'*+\-/-9=?A-Z\^-\uFFFF](?:\.?[!#-'*+\-/-9=?A-Z\^-\uFFFF])*|\[[!-Z\^-\uFFFF]*\])$/

Does that work for you?

@awwright awwright changed the title v1.4.1 not support chrome 49 v1.4.1 does not support chrome 49 Jul 1, 2022
@ayonix
Copy link

ayonix commented Jul 1, 2022

That regex alone seems to work, in 1.4.1 are more issues for IE though.
When i replace the regex with yours, the next complaint of it is: SCRIPT5021: Invalid range in character set which seems to be the [~-\u{10FFFF}] in iri-reference.
Also there are more /u flags on regexes: iri-reference,uri-template,json-pointer,relative-json-pointer and maybe something else I've missed.
Thanks for looking into it :)

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