File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11define ( function ( ) {
22 // Match a standalone tag
3- return ( / ^ < ( \w + ) \s * \/ ? > (?: < \/ \1> | ) $ / ) ;
3+ return ( / ^ < ( [ \w - ] + ) \s * \/ ? > (?: < \/ \1> | ) $ / ) ;
44} ) ;
Original file line number Diff line number Diff line change @@ -637,6 +637,19 @@ test("jQuery('html')", function() {
637637 equal ( jQuery ( "\\<div\\>" ) . length , 0 , "Ignore escaped html characters" ) ;
638638} ) ;
639639
640+ test ( "jQuery(tag-hyphenated elements) gh-1987" , function ( ) {
641+ expect ( 17 ) ;
642+
643+ jQuery . each ( "thead tbody tfoot colgroup caption tr th td" . split ( " " ) , function ( i , name ) {
644+ var j = jQuery ( "<" + name + "-d></" + name + "-d>" ) ;
645+ ok ( j [ 0 ] , "Create a tag-hyphenated elements" ) ;
646+ ok ( jQuery . nodeName ( j [ 0 ] , name . toUpperCase ( ) + "-D" ) , "Tag-hyphenated element has expected node name" ) ;
647+ } ) ;
648+
649+ var j = jQuery ( "<tr-multiple-hyphens></tr-multiple-hyphens>" ) ;
650+ ok ( jQuery . nodeName ( j [ 0 ] , "TR-MULTIPLE-HYPHENS" ) , "Element with multiple hyphens in its tag has expected node name" ) ;
651+ } ) ;
652+
640653test ( "jQuery('massive html #7990')" , function ( ) {
641654 expect ( 3 ) ;
642655
You can’t perform that action at this time.
0 commit comments