mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Revert "Fix #12350. Remove BOM in jQuery.trim. Close gh-897."
This reverts commit 2b5b4ebbd7
.
String.prototype.trim doesn't trim BOM in Safari 5.0 so this won't work without additional feature detects.
http://swarm.jquery.org/result/165379
This commit is contained in:
parent
0f553ed0ca
commit
ac043b1bc8
@ -130,5 +130,4 @@ Uri Gilad <antishok@gmail.com>
|
|||||||
Chris Faulkner <thefaulkner@gmail.com>
|
Chris Faulkner <thefaulkner@gmail.com>
|
||||||
Elijah Manor <elijah.manor@gmail.com>
|
Elijah Manor <elijah.manor@gmail.com>
|
||||||
Daniel Chatfield <chatfielddaniel@googlemail.com>
|
Daniel Chatfield <chatfielddaniel@googlemail.com>
|
||||||
Nikita Govorov <nikita.govorov@gmail.com>
|
Nikita Govorov <nikita.govorov@gmail.com>
|
||||||
Wesley Walser <wwalser@atlassian.com>
|
|
@ -37,8 +37,8 @@ var
|
|||||||
core_rnotwhite = /\S/,
|
core_rnotwhite = /\S/,
|
||||||
core_rspace = /\s+/,
|
core_rspace = /\s+/,
|
||||||
|
|
||||||
// IE doesn't match many whitespace characters with \s
|
// IE doesn't match non-breaking spaces with \s
|
||||||
rtrim = core_rnotwhite.test("\xA0") ? /^[\s\xA0\uFEFF]+|[\s\xA0\uFEFF]+$/g : /^\s+|\s+$/g,
|
rtrim = core_rnotwhite.test("\xA0") ? (/^[\s\xA0]+|[\s\xA0]+$/g) : /^\s+|\s+$/g,
|
||||||
|
|
||||||
// A simple way to check for HTML strings
|
// A simple way to check for HTML strings
|
||||||
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
||||||
|
@ -264,7 +264,7 @@ test("noConflict", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("trim", function() {
|
test("trim", function() {
|
||||||
expect(13);
|
expect(9);
|
||||||
|
|
||||||
var nbsp = String.fromCharCode(160);
|
var nbsp = String.fromCharCode(160);
|
||||||
|
|
||||||
@ -278,11 +278,6 @@ test("trim", function() {
|
|||||||
equal( jQuery.trim( null ), "", "Null" );
|
equal( jQuery.trim( null ), "", "Null" );
|
||||||
equal( jQuery.trim( 5 ), "5", "Number" );
|
equal( jQuery.trim( 5 ), "5", "Number" );
|
||||||
equal( jQuery.trim( false ), "false", "Boolean" );
|
equal( jQuery.trim( false ), "false", "Boolean" );
|
||||||
|
|
||||||
equal( jQuery.trim(" "), "", "space should be trimmed" );
|
|
||||||
equal( jQuery.trim("ipad\xA0"), "ipad", "nbsp should be trimmed" );
|
|
||||||
equal( jQuery.trim("\uFEFF"), "", "zwsp should be trimmed" );
|
|
||||||
equal( jQuery.trim("\uFEFF \xA0! | \uFEFF"), "! |", "leading/trailing should be trimmed" );
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("type", function() {
|
test("type", function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user