aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/manipulation.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-01-13 15:23:05 -0500
committerjeresig <jeresig@gmail.com>2010-01-13 15:23:05 -0500
commitd431519d61f55af8bd1714d00126c948d888f3a9 (patch)
treea5c7c60ea6f834f585c30c16b7e0557a61d0e204 /test/unit/manipulation.js
parent1960f28c0bf75b16e88460d6135058fd93202322 (diff)
downloadjquery-d431519d61f55af8bd1714d00126c948d888f3a9.tar.gz
jquery-d431519d61f55af8bd1714d00126c948d888f3a9.zip
We only care that some of the html return value is escaped, not necessarily all of it (as is the case in Safari 3.x).
Diffstat (limited to 'test/unit/manipulation.js')
-rw-r--r--test/unit/manipulation.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index bb78bdd2b..c250b53e7 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -828,9 +828,9 @@ var testHtml = function(valueObj) {
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." );
+ equals( $div2.html(insert).html().replace(/>/g, "&gt;"), insert, "Verify escaped insertion." );
+ equals( $div2.html("x" + insert).html().replace(/>/g, "&gt;"), "x" + insert, "Verify escaped insertion." );
+ equals( $div2.html(" " + insert).html().replace(/>/g, "&gt;"), " " + insert, "Verify escaped insertion." );
var map = jQuery("<map/>").html(valueObj("<area id='map01' shape='rect' coords='50,50,150,150' href='http://www.jquery.com/' alt='jQuery'>"));
@@ -908,17 +908,17 @@ test("html(Function) with incoming value", function() {
equals( $div2.html(function(i, val) {
equals( val, "", "Make sure the incoming value is correct." );
return insert;
- }).html(), insert, "Verify escaped insertion." );
+ }).html().replace(/>/g, "&gt;"), insert, "Verify escaped insertion." );
equals( $div2.html(function(i, val) {
- equals( val, insert, "Make sure the incoming value is correct." );
+ equals( val.replace(/>/g, "&gt;"), insert, "Make sure the incoming value is correct." );
return "x" + insert;
- }).html(), "x" + insert, "Verify escaped insertion." );
+ }).html().replace(/>/g, "&gt;"), "x" + insert, "Verify escaped insertion." );
equals( $div2.html(function(i, val) {
- equals( val, "x" + insert, "Make sure the incoming value is correct." );
+ equals( val.replace(/>/g, "&gt;"), "x" + insert, "Make sure the incoming value is correct." );
return " " + insert;
- }).html(), " " + insert, "Verify escaped insertion." );
+ }).html().replace(/>/g, "&gt;"), " " + insert, "Verify escaped insertion." );
});
var testRemove = function(method) {