mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-09 14:54:04 +02:00
Merge pull request #20745 from calixteman/issue20744
Don't check for surrogates when verifying the chars to normalize
This commit is contained in:
commit
2bab2a87a4
@ -140,6 +140,9 @@ function getNormalizeWithNFKC() {
|
||||
const diacriticsRegex = /^\p{M}$/u;
|
||||
// Some chars must be replaced by their NFKC counterpart during a search.
|
||||
for (let i = 0; i < 65536; i++) {
|
||||
if (i >= 0xd800 && i <= 0xdfff) {
|
||||
continue; // Skip surrogates since they're not valid Unicode scalar values.
|
||||
}
|
||||
const c = String.fromCharCode(i);
|
||||
if (c.normalize("NFKC") !== c && !diacriticsRegex.test(c)) {
|
||||
if (range.length !== 2) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user