rselfClosing = /^(?:abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
- rhtml = /</,
+ rhtml = /<|&\w+;/,
fcloseTag = function(all, front, tag){
return rselfClosing.test(tag) ?
all :
})
var testHtml = function(valueObj) {
- expect(17);
+ expect(20);
window.debug = true;
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 = "<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('<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>'));