-
-
Notifications
You must be signed in to change notification settings - Fork 825
Simplify script detection using regular expressions #4560
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4560 +/- ##
===========================================
+ Coverage 65.31% 88.03% +22.71%
===========================================
Files 247 247
Lines 33493 33494 +1
Branches 1778 2365 +587
===========================================
+ Hits 21877 29487 +7610
+ Misses 10768 3056 -7712
- Partials 848 951 +103 ☔ View full report in Codecov by Sentry. |
3d20399
to
08b19c7
Compare
Simplified the logic for preferring local glyph rendering to consider the script, which requires less maintenance than a hard-coded list of blocks.
44223a6
to
9dbc7ce
Compare
I'm having a hard time understanding the difference between the two PR related to these files. |
#4560 is now based on #4560 (this PR). The diff in #4560 is cumulative of both PRs, but for the purpose of that PR, I would ask you to ignore the first five commits and focus on the last three commits. Unfortunately, I can’t tell GitHub to set the target of that branch to this branch, because I created both PRs from a fork. I recommend first reviewing the changes in #4560 (this PR), as suggested in #4550 (comment). If you agree, merge this PR to main; then #4560 will automatically rebase atop main to become much simpler without these five commits. |
Ok, I'll review this first. |
Sure, have at it! |
Simplified some internationalization-related code to match a given character against a regular expression that tests the Unicode script instead of manually checking whether it falls inside the ranges of a series of Unicode blocks. This is more future-proof because it offloads some decisionmaking onto the browser. Unfortunately, the most verbose methods related to vertical orientation must still be maintained by hand, because the ECMAScript standard doesn’t allow browsers to support the other relevant Unicode character properties. But at least the diff in #4550 will end up a bit shorter as a result.
Fixes #4541.
Launch Checklist
CHANGELOG.md
under the## main
section.