From 7c4144fab314d98b85303d01ab904bb711bc2ecc Mon Sep 17 00:00:00 2001 From: John Resig Date: Wed, 11 Nov 2009 14:23:56 -0500 Subject: Fixed the case where HTML that contained entities was being inserted as text strings instead of HTML. Thanks to dmethvin for the test case! Fixes #5483. --- test/unit/manipulation.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 00984168c..0f11de41c 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -643,7 +643,7 @@ test("val(Function)", function() { }) var testHtml = function(valueObj) { - expect(17); + expect(20); window.debug = true; @@ -676,6 +676,12 @@ var testHtml = function(valueObj) { equals( $div.html(valueObj( 5 )).html(), '5', 'Setting a number as html' ); equals( $div.html(valueObj( 0 )).html(), '0', 'Setting a zero as html' ); + var $div2 = jQuery('
'), insert = "<div>hello1</div>"; + equals( $div2.html(insert).html(), insert, "Verify escaped insertion." ); + equals( $div2.html("x" + insert).html(), "x" + insert, "Verify escaped insertion." ); + equals( $div2.html(" " + insert).html(), " " + insert, "Verify escaped insertion." ); + + reset(); jQuery("#main").html(valueObj('
')); -- cgit v1.2.3