aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-11-11 14:23:56 -0500
committerJohn Resig <jeresig@gmail.com>2009-11-11 14:23:56 -0500
commit7c4144fab314d98b85303d01ab904bb711bc2ecc (patch)
tree3986d45973203814632022cbf5976c1e27676373 /test
parent449e099b97d823ed0252d8821880bc0e471701ea (diff)
downloadjquery-7c4144fab314d98b85303d01ab904bb711bc2ecc.tar.gz
jquery-7c4144fab314d98b85303d01ab904bb711bc2ecc.zip
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.
Diffstat (limited to 'test')
-rw-r--r--test/unit/manipulation.js8
1 files changed, 7 insertions, 1 deletions
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('<div/>'), insert = "&lt;div&gt;hello1&lt;/div&gt;";
+ 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('<script type="something/else">ok( false, "Non-script evaluated." );</script><script type="text/javascript">ok( true, "text/javascript is evaluated." );</script><script>ok( true, "No type is evaluated." );</script><div><script type="text/javascript">ok( true, "Inner text/javascript is evaluated." );</script><script>ok( true, "Inner No type is evaluated." );</script><script type="something/else">ok( false, "Non-script evaluated." );</script></div>'));