Commit df6e02a4 authored by jeresig's avatar jeresig

Merge branch 'master' of github.com:jquery/jquery

parents 90ba57ce 17955cac
...@@ -29,7 +29,7 @@ var jQuery = function( selector, context ) { ...@@ -29,7 +29,7 @@ var jQuery = function( selector, context ) {
rnotwhite = /\S/, rnotwhite = /\S/,
// Used for trimming whitespace // Used for trimming whitespace
rtrim = /^\s+|\s+$/g, rtrim = /(\s|\u00A0)+|(\s|\u00A0)+$/g,
// Match a standalone tag // Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
......
...@@ -189,6 +189,17 @@ test("noConflict", function() { ...@@ -189,6 +189,17 @@ test("noConflict", function() {
jQuery = $$; 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", "&nbsp;" );
});
test("isFunction", function() { test("isFunction", function() {
expect(19); expect(19);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment