Commit 9791855e authored by John Resig's avatar John Resig

Fix for bug #962.

parent 6b729ff7
...@@ -213,7 +213,7 @@ test("wrap(String|Element)", function() { ...@@ -213,7 +213,7 @@ test("wrap(String|Element)", function() {
}); });
test("append(String|Element|Array<Element>|jQuery)", function() { test("append(String|Element|Array<Element>|jQuery)", function() {
expect(10); expect(11);
var defaultText = 'Try them out:' var defaultText = 'Try them out:'
var result = $('#first').append('<b>buga</b>'); var result = $('#first').append('<b>buga</b>');
ok( result.text() == defaultText + 'buga', 'Check if text appending works' ); ok( result.text() == defaultText + 'buga', 'Check if text appending works' );
...@@ -238,6 +238,10 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() { ...@@ -238,6 +238,10 @@ test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
$("#sap").append( 5 ); $("#sap").append( 5 );
ok( $("#sap")[0].innerHTML.match( /5$/ ), "Check for appending a number" ); 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(); reset();
ok( $("#sap").append([]), "Check for appending an empty array." ); ok( $("#sap").append([]), "Check for appending an empty array." );
ok( $("#sap").append(""), "Check for appending an empty string." ); ok( $("#sap").append(""), "Check for appending an empty string." );
......
...@@ -1472,7 +1472,7 @@ jQuery.extend({ ...@@ -1472,7 +1472,7 @@ jQuery.extend({
[0,"",""]; [0,"",""];
// Go to html and back, then peel off extra wrappers // 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 // Move to the right depth
while ( wrap[0]-- ) while ( wrap[0]-- )
......
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