Index: src/jquery/coreTest.js =================================================================== --- src/jquery/coreTest.js (revision 1434) +++ src/jquery/coreTest.js (working copy) @@ -213,7 +213,7 @@ }); test("append(String|Element|Array<Element>|jQuery)", function() { - expect(10); + expect(11); var defaultText = 'Try them out:' var result = $('#first').append('buga'); ok( result.text() == defaultText + 'buga', 'Check if text appending works' ); @@ -239,6 +239,10 @@ ok( $("#sap")[0].innerHTML.match( /5$/ ), "Check for appending a number" ); reset(); + $("#sap").append( " text with spaces " ); + ok( $("#sap")[0].innerHTML.match(/ text with spaces $/), "Check for appending text with spaces" ); + + reset(); ok( $("#sap").append([]), "Check for appending an empty array." ); ok( $("#sap").append(""), "Check for appending an empty string." ); ok( $("#sap").append(document.getElementsByTagName("foo")), "Check for appending an empty nodelist." ); @@ -698,4 +702,4 @@ //console.log( close[0]); // it's the and not a element return false; }).click(); -}); \ No newline at end of file +}); Index: src/jquery/jquery.js =================================================================== --- src/jquery/jquery.js (revision 1434) +++ src/jquery/jquery.js (working copy) @@ -1445,7 +1445,7 @@ [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]-- )