File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ var jQuery = function( selector, context ) {
29
29
rnotwhite = / \S / ,
30
30
31
31
// Used for trimming whitespace
32
- rtrim = / ^ \s + | \s + $ / g,
32
+ rtrim = / ( \s | \u00A0 ) + | ( \s | \u00A0 ) + $ / g,
33
33
34
34
// Match a standalone tag
35
35
rsingleTag = / ^ < ( \w + ) \s * \/ ? > (?: < \/ \1> ) ? $ / ,
Original file line number Diff line number Diff line change @@ -189,6 +189,17 @@ test("noConflict", function() {
189
189
jQuery = $$ ;
190
190
} ) ;
191
191
192
+ test ( "trim" , function ( ) {
193
+ expect ( 4 ) ;
194
+
195
+ var nbsp = String . fromCharCode ( 160 ) ;
196
+
197
+ equals ( jQuery . trim ( "hello " ) , "hello" , "trailing space" ) ;
198
+ equals ( jQuery . trim ( " hello" ) , "hello" , "leading space" ) ;
199
+ equals ( jQuery . trim ( " hello " ) , "hello" , "space on both sides" ) ;
200
+ equals ( jQuery . trim ( " " + nbsp + "hello " + nbsp + " " ) , "hello" , " " ) ;
201
+ } ) ;
202
+
192
203
test ( "isFunction" , function ( ) {
193
204
expect ( 19 ) ;
194
205
You can’t perform that action at this time.
0 commit comments