Permalink
Browse files

Core: add support to tag-hyphenated elements

Ref #1987
Ref 534f130
  • Loading branch information...
LeonardoBraga authored and markelog committed Jan 4, 2015
1 parent abfb10c commit f19595cef4a01d52ade451e90b0a1d2ceb5afe43
Showing with 14 additions and 1 deletion.
  1. +1 −1 src/core/var/rsingleTag.js
  2. +13 −0 test/unit/core.js
@@ -1,4 +1,4 @@
define(function() {
// Match a standalone tag
- return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
+ return (/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/);
});
View
@@ -599,6 +599,19 @@ test("jQuery('html')", function() {
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() {
expect( 3 );

0 comments on commit f19595c

Please sign in to comment.