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

Fix for unicode regex in IE/firefox #408

Merged
merged 1 commit into from
Apr 28, 2020
Merged

Conversation

nmetulev
Copy link
Contributor

Closes #406

PR Type

  • Bugfix

Description of the changes

Firefox and some other browsers do not implement 'u' for uncicode regex. The fix adds a fallback in those browsers.

Tested in Edge, Chrome, Firefox and IE11

PR checklist

  • Project builds (npm run build) and changes have been tested in supported browsers (including IE11)
  • All public classes and methods have been documented
  • Added appropriate documentation [target branch mgt/next for new features]. Docs PR:
  • Contains NO breaking changes

Other information

try {
return char.match(new RegExp('\\p{L}', 'u'));
} catch (e) {
return char.toLowerCase() !== char.toUpperCase();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever! I like it

@shweaver-MSFT shweaver-MSFT merged commit 0053a6f into release/latest Apr 28, 2020
@shweaver-MSFT shweaver-MSFT deleted the nmetulev/ffregex branch April 28, 2020 22:19
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

Successfully merging this pull request may close these issues.

2 participants