]> source.dussan.org Git - jquery.git/commitdiff
Restore rhtmlString to its original form. 1.9 will come with starts-with html matchin...
authortimmywil <timmywillisn@gmail.com>
Wed, 20 Jun 2012 20:22:36 +0000 (16:22 -0400)
committertimmywil <timmywillisn@gmail.com>
Thu, 21 Jun 2012 15:38:31 +0000 (11:38 -0400)
src/core.js
test/unit/core.js

index 1bf7e56039e73653ce9cc4f413a8c6cd7e810c7f..c0113a190b754cb6dcda138468dac24acd483099 100644 (file)
@@ -41,8 +41,7 @@ var
 
        // A simple way to check for HTML strings
        // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-       // Ignore html if within quotes "" '' or brackets/parens [] ()
-       rhtmlString = /^(?:[^#<\\]*(<[\w\W]+>)(?![^\[]*\])(?![^\(]*\))(?![^']*')(?![^"]*")[^>]*$)/,
+       rhtmlString = /^(?:[^#<]*(<[\w\W]+>)[^>]*$)/,
 
        // Match a standalone tag
        rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
index 0b392adf199bbb3cb9652b85649d62ccda9f677b..95f26fcbd2af961087d617e6afeb05a211f54fef 100644 (file)
@@ -605,7 +605,7 @@ test("isWindow", function() {
 });
 
 test("jQuery('html')", function() {
-       expect( 22 );
+       expect( 18 );
 
        QUnit.reset();
        jQuery.foo = false;
@@ -638,10 +638,10 @@ test("jQuery('html')", function() {
        ok( jQuery("<div></div>")[0], "Create a div with closing tag." );
        ok( jQuery("<table></table>")[0], "Create a table with closing tag." );
 
-       equal( jQuery("element[attribute='<div></div>']").length, 0, "When html is within brackets, do not recognize as html." );
-       equal( jQuery("element[attribute=<div></div>]").length, 0, "When html is within brackets, do not recognize as html." );
-       equal( jQuery("element:not(<div></div>)").length, 0, "When html is within parens, do not recognize as html." );
-       equal( jQuery("\\<div\\>").length, 0, "Ignore escaped html characters" );
+       // equal( jQuery("element[attribute='<div></div>']").length, 0, "When html is within brackets, do not recognize as html." );
+       // equal( jQuery("element[attribute=<div></div>]").length, 0, "When html is within brackets, do not recognize as html." );
+       // equal( jQuery("element:not(<div></div>)").length, 0, "When html is within parens, do not recognize as html." );
+       // equal( jQuery("\\<div\\>").length, 0, "Ignore escaped html characters" );
 
        // Test very large html string #7990
        var i;