mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Bug 1935981 - Improve "given-name" heuristic for Japan r=NeilDeakin,credential-management-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D266778
This commit is contained in:
1 parent
fc74e7d237
commit
1690825dc3
1 file changed
+9
-2
@@ -555,7 +555,7 @@ export const HeuristicsRegExp = {
|
||||
"|vorname" + // de-DE
|
||||
"|nombre" + // es
|
||||
"|forename|prénom|prenom" + // fr-FR
|
||||
"|名" + // ja-JP
|
||||
"|(^|[^\\p{L}\\p{N}])名([^\\p{L}\\p{N}]|$)" + // ja-JP
|
||||
"|nome" + // pt-BR, pt-PT
|
||||
"|Имя" + // ru
|
||||
"|نام" + // fa
|
||||
@@ -692,7 +692,14 @@ export const HeuristicsRegExp = {
|
||||
// lower-cased field name and get a rough equivalent of a case-insensitive
|
||||
// match. This avoids a performance cliff with the "iu" flag on regular
|
||||
// expressions.
|
||||
regexps.push(`(${set[name].toLowerCase()})`.normalize("NFKC"));
|
||||
let pattern = `(${set[name].toLowerCase()})`.normalize("NFKC");
|
||||
|
||||
// We should not lower case the \p{L} & \p{N} parts of the pattern,
|
||||
// revert them back.
|
||||
pattern = pattern.replaceAll("\\p{l}", "\\p{L}");
|
||||
pattern = pattern.replaceAll("\\p{n}", "\\p{N}");
|
||||
|
||||
regexps.push(pattern);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user