Skip to content

Commit

Permalink
Remove backslashes from tag name filter. Fixes #8220.
Browse files Browse the repository at this point in the history
  • Loading branch information
jitter committed Feb 10, 2011
1 parent 4298914 commit 7fd5ef0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sizzle.js
Expand Up @@ -502,7 +502,7 @@ var Expr = Sizzle.selectors = {
},

TAG: function( match, curLoop ) {
return match[1].toLowerCase();
return match[1].replace( rBackslash, "" ).toLowerCase();
},

CHILD: function( match ) {
Expand Down
5 changes: 3 additions & 2 deletions test/unit/selector.js
Expand Up @@ -41,7 +41,7 @@ test("element", function() {

if ( location.protocol != "file:" ) {
test("XML Document Selectors", function() {
expect(8);
expect(9);
stop();
jQuery.get("data/with_fries.xml", function(xml) {
equals( jQuery("foo_bar", xml).length, 1, "Element Selector with underscore" );
Expand All @@ -52,6 +52,7 @@ if ( location.protocol != "file:" ) {
equals( jQuery("#seite1", xml).length, 1, "Attribute selector with ID" );
equals( jQuery("component#seite1", xml).length, 1, "Attribute selector with ID" );
equals( jQuery("component", xml).filter("#seite1").length, 1, "Attribute selector filter with ID" );
ok( jQuery( xml.lastChild ).is( "soap\\:Envelope" ), "Check for namespaced element" );
start();
});
});
Expand Down Expand Up @@ -337,7 +338,7 @@ test("attributes", function() {
//#3279
var div = document.createElement("div");
div.innerHTML = "<div id='foo' xml:test='something'></div>";

deepEqual( jQuery( "[xml\\:test]", div ).get(), [ div.firstChild ], "Finding by attribute with escaped characters." );
});

Expand Down

0 comments on commit 7fd5ef0

Please sign in to comment.