aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/core.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2013-05-08 21:07:41 -0400
committerDave Methvin <dave.methvin@gmail.com>2013-05-09 14:53:15 -0400
commit9fdbc8bf33418f7b3a3a88df9a04ffee53c8dc66 (patch)
tree627b49f56c0415fbf023c4291467ab7acdf6e269 /test/unit/core.js
parentc9267ab078ad223eceb381fb45ab06a86baccfb0 (diff)
downloadjquery-9fdbc8bf33418f7b3a3a88df9a04ffee53c8dc66.tar.gz
jquery-9fdbc8bf33418f7b3a3a88df9a04ffee53c8dc66.zip
Fix #13223. Re-allow leading space in HTML. Close gh-1264.
(cherry picked from commit 00eafdf028f7730665ce1c05ab44e3f0bc80fbc2)
Diffstat (limited to 'test/unit/core.js')
-rw-r--r--test/unit/core.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 60b8e7272..7770000e5 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -38,7 +38,7 @@ test("jQuery()", function() {
div = jQuery("<div/><hr/><code/><b/>"),
exec = false,
lng = "",
- expected = 20,
+ expected = 22,
attrObj = {
"text": "test",
"class": "test2",
@@ -113,6 +113,12 @@ test("jQuery()", function() {
equal( jQuery(document.body).get(0), jQuery("body").get(0), "Test passing an html node to the factory" );
+ elem = jQuery(" <em>hello</em>")[0];
+ equal( elem.nodeName.toLowerCase(), "em", "leading space" );
+
+ elem = jQuery("\n\n<em>world</em>")[0];
+ equal( elem.nodeName.toLowerCase(), "em", "leading newlines" );
+
elem = jQuery("<div/>", attrObj );
if ( jQuery.fn.width ) {