Make sure that XHTML-style HTML is purified in .html(). Fixes #5845.
[jquery.git] / test / unit / manipulation.js
index 7db8d5b..16992ae 100644 (file)
@@ -793,7 +793,7 @@ test("clone() on XML nodes", function() {
 }
 
 var testHtml = function(valueObj) {
-       expect(22);
+       expect(24);
 
        jQuery.scriptorder = 0;
 
@@ -805,6 +805,11 @@ var testHtml = function(valueObj) {
        }
        ok( pass, "Set HTML" );
 
+       div = jQuery("<div/>").html( valueObj('<div id="parent_1"><div id="child_1"/></div><div id="parent_2"/>') );
+
+       equals( div.children().length, 2, "Make sure two child nodes exist." );
+       equals( div.children().children().length, 1, "Make sure that a grandchild exists." );
+
        reset();
        // using contents will get comments regular, text, and comment nodes
        var j = jQuery("#nonnodes").contents();
@@ -1040,4 +1045,4 @@ test("jQuery.cleanData", function() {
                
                return div;
        }
-});
\ No newline at end of file
+});