File tree 3 files changed +10
-4
lines changed
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -130,4 +130,5 @@ Uri Gilad <antishok@gmail.com>
130
130
Chris Faulkner <thefaulkner@gmail.com>
131
131
Elijah Manor <elijah.manor@gmail.com>
132
132
Daniel Chatfield <chatfielddaniel@googlemail.com>
133
- Nikita Govorov <nikita.govorov@gmail.com>
133
+ Nikita Govorov <nikita.govorov@gmail.com>
134
+ Wesley Walser <wwalser@atlassian.com>
Original file line number Diff line number Diff line change 37
37
core_rnotwhite = / \S / ,
38
38
core_rspace = / \s + / ,
39
39
40
- // IE doesn't match non-breaking spaces with \s
41
- rtrim = core_rnotwhite . test ( "\xA0" ) ? ( / ^ [ \s \xA0 ] + | [ \s \xA0 ] + $ / g) : / ^ \s + | \s + $ / g,
40
+ // IE doesn't match many whitespace characters with \s
41
+ rtrim = core_rnotwhite . test ( "\xA0" ) ? / ^ [ \s \xA0 \uFEFF ] + | [ \s \xA0 \uFEFF ] + $ / g : / ^ \s + | \s + $ / g,
42
42
43
43
// A simple way to check for HTML strings
44
44
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ test("noConflict", function() {
264
264
} ) ;
265
265
266
266
test ( "trim" , function ( ) {
267
- expect ( 9 ) ;
267
+ expect ( 13 ) ;
268
268
269
269
var nbsp = String . fromCharCode ( 160 ) ;
270
270
@@ -278,6 +278,11 @@ test("trim", function() {
278
278
equal ( jQuery . trim ( null ) , "" , "Null" ) ;
279
279
equal ( jQuery . trim ( 5 ) , "5" , "Number" ) ;
280
280
equal ( jQuery . trim ( false ) , "false" , "Boolean" ) ;
281
+
282
+ equal ( jQuery . trim ( " " ) , "" , "space should be trimmed" ) ;
283
+ equal ( jQuery . trim ( "ipad\xA0" ) , "ipad" , "nbsp should be trimmed" ) ;
284
+ equal ( jQuery . trim ( "\uFEFF" ) , "" , "zwsp should be trimmed" ) ;
285
+ equal ( jQuery . trim ( "\uFEFF \xA0! | \uFEFF" ) , "! |" , "leading/trailing should be trimmed" ) ;
281
286
} ) ;
282
287
283
288
test ( "type" , function ( ) {
You can’t perform that action at this time.
0 commit comments