Fix for bug #962.
authorJohn Resig <jeresig@gmail.com>
Thu, 1 Mar 2007 05:16:34 +0000 (05:16 +0000)
committerJohn Resig <jeresig@gmail.com>
Thu, 1 Mar 2007 05:16:34 +0000 (05:16 +0000)
src/jquery/coreTest.js
src/jquery/jquery.js

index 25cb69b..c20d406 100644 (file)
@@ -213,7 +213,7 @@ test("wrap(String|Element)", function() {
 });\r
 \r
 test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {\r
-       expect(10);\r
+       expect(11);\r
        var defaultText = 'Try them out:'\r
        var result = $('#first').append('<b>buga</b>');\r
        ok( result.text() == defaultText + 'buga', 'Check if text appending works' );\r
@@ -239,6 +239,10 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
        ok( $("#sap")[0].innerHTML.match( /5$/ ), "Check for appending a number" );\r
 \r
        reset();\r
+       $("#sap").append( " text with spaces " );\r
+       ok( $("#sap")[0].innerHTML.match(/ text with spaces $/), "Check for appending text with spaces" );\r
+\r
+       reset();\r
        ok( $("#sap").append([]), "Check for appending an empty array." );\r
        ok( $("#sap").append(""), "Check for appending an empty string." );\r
        ok( $("#sap").append(document.getElementsByTagName("foo")), "Check for appending an empty nodelist." );\r
@@ -698,4 +702,4 @@ test("click() context", function() {
            //console.log( close[0]); // it's the <a> and not a <span> element\r
            return false;\r
        }).click();\r
-});
\ No newline at end of file
+});\r
index 5780ba7..4874037 100644 (file)
@@ -1472,7 +1472,7 @@ jQuery.extend({
                                        [0,"",""];
 
                                // Go to html and back, then peel off extra wrappers
-                               div.innerHTML = wrap[1] + s + wrap[2];
+                               div.innerHTML = wrap[1] + arg + wrap[2];
                                
                                // Move to the right depth
                                while ( wrap[0]-- )