File tree 2 files changed +34
-1
lines changed 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -2212,7 +2212,7 @@ var Gmail_ = function(localJQuery) {
2212
2212
2213
2213
2214
2214
api . tools . extract_name = function ( str ) {
2215
- var regex = / [ a - z " . _ - \s ] + / gi;
2215
+ var regex = / [ a - z \u00A0 - \uD7FF \uF900 - \uFDCF \uFDF0 - \uFFEF " . _ \s - ] + / gi;
2216
2216
var matches = ( str ) ? str . match ( regex ) : undefined ;
2217
2217
2218
2218
return ( matches && matches [ 0 ] ) ? matches [ 0 ] . trim ( ) : undefined ;
Original file line number Diff line number Diff line change @@ -97,3 +97,36 @@ describe("Current-page parsing", () => {
97
97
}
98
98
} ) ;
99
99
} ) ;
100
+
101
+ describe ( "Name-parsing" , ( ) => {
102
+
103
+ const gmail = new Gmail ( ) ;
104
+ const testName = function ( source ) {
105
+ const result = gmail . tools . extract_name ( source + " <>" ) ;
106
+ assert . deepEqual ( result , source ) ;
107
+ } ;
108
+
109
+ it ( "handles no spaces in name" , ( ) => {
110
+ testName ( "Burt" ) ;
111
+ } ) ;
112
+
113
+ it ( "handles spaces in name" , ( ) => {
114
+ testName ( "Curt Cobain" ) ;
115
+ } ) ;
116
+
117
+ it ( "handles vikings" , ( ) => {
118
+ testName ( "Jostein Kjønigsen" ) ;
119
+ } ) ;
120
+
121
+ it ( "handles zeh germans" , ( ) => {
122
+ testName ( "Frunk Münster" ) ;
123
+ } ) ;
124
+
125
+ it ( "handles le frenchies" , ( ) => {
126
+ testName ( "Madamoselle Emálie" ) ;
127
+ } ) ;
128
+
129
+ it ( "handles mexicans" , ( ) => {
130
+ testName ( "Senõr Alapenõ on a stick" ) ;
131
+ } ) ;
132
+ } ) ;
You can’t perform that action at this time.
0 commit comments