rnotwhite = /\S/,
// Used for trimming whitespace
- rtrim = /^\s+|\s+$/g,
+ rtrim = /(\s|\u00A0)+|(\s|\u00A0)+$/g,
// Match a standalone tag
rsingleTag = /<(\w+)\s*\/?>(?:<\/\1>)?$/,
jQuery = $$;
});
+test("trim", function() {
+ expect(4);
+
+ var nbsp = String.fromCharCode(160);
+
+ equals( jQuery.trim("hello "), "hello", "trailing space" );
+ equals( jQuery.trim(" hello"), "hello", "leading space" );
+ equals( jQuery.trim(" hello "), "hello", "space on both sides" );
+ equals( jQuery.trim(" " + nbsp + "hello " + nbsp + " "), "hello", " " );
+});
+
test("isFunction", function() {
expect(19);