Commit f19595ce authored by Leonardo Braga's avatar Leonardo Braga Committed by Oleg Gaidarenko

Core: add support to tag-hyphenated elements

Ref #1987
Ref 534f13025aeb59a7d5893ce62efafa0b066a4934
parent abfb10c8
define(function() { define(function() {
// Match a standalone tag // Match a standalone tag
return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); return (/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/);
}); });
...@@ -599,6 +599,19 @@ test("jQuery('html')", function() { ...@@ -599,6 +599,19 @@ test("jQuery('html')", function() {
equal( jQuery( "\\<div\\>" ).length, 0, "Ignore escaped html characters" ); equal( jQuery( "\\<div\\>" ).length, 0, "Ignore escaped html characters" );
}); });
test("jQuery(tag-hyphenated elements) gh-1987", function() {
expect( 17 );
jQuery.each( "thead tbody tfoot colgroup caption tr th td".split(" "), function( i, name ) {
var j = jQuery("<" + name + "-d></" + name + "-d>");
ok( j[0], "Create a tag-hyphenated elements" );
ok( jQuery.nodeName(j[0], name.toUpperCase() + "-D"), "Tag-hyphenated element has expected node name" );
});
var j = jQuery("<tr-multiple-hyphens></tr-multiple-hyphens>");
ok( jQuery.nodeName(j[0], "TR-MULTIPLE-HYPHENS"), "Element with multiple hyphens in its tag has expected node name" );
});
test("jQuery('massive html #7990')", function() { test("jQuery('massive html #7990')", function() {
expect( 3 ); expect( 3 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment