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 1
1
define ( function ( ) {
2
2
// Match a standalone tag
3
- return ( / ^ < ( \w + ) \s * \/ ? > (?: < \/ \1> | ) $ / ) ;
3
+ return ( / ^ < ( [ \w - ] + ) \s * \/ ? > (?: < \/ \1> | ) $ / ) ;
4
4
} ) ;
Original file line number Diff line number Diff line change @@ -594,6 +594,19 @@ test("jQuery('html')", function() {
594
594
equal ( jQuery ( "\\<div\\>" ) . length , 0 , "Ignore escaped html characters" ) ;
595
595
} ) ;
596
596
597
+ test ( "jQuery(tag-hyphenated elements) gh-1987" , function ( ) {
598
+ expect ( 17 ) ;
599
+
600
+ jQuery . each ( "thead tbody tfoot colgroup caption tr th td" . split ( " " ) , function ( i , name ) {
601
+ var j = jQuery ( "<" + name + "-d></" + name + "-d>" ) ;
602
+ ok ( j [ 0 ] , "Create a tag-hyphenated elements" ) ;
603
+ ok ( jQuery . nodeName ( j [ 0 ] , name . toUpperCase ( ) + "-D" ) , "Tag-hyphenated element has expected node name" ) ;
604
+ } ) ;
605
+
606
+ var j = jQuery ( "<tr-multiple-hyphens></tr-multiple-hyphens>" ) ;
607
+ ok ( jQuery . nodeName ( j [ 0 ] , "TR-MULTIPLE-HYPHENS" ) , "Element with multiple hyphens in its tag has expected node name" ) ;
608
+ } ) ;
609
+
597
610
test ( "jQuery('massive html #7990')" , function ( ) {
598
611
expect ( 3 ) ;
599
612
You can’t perform that action at this time.
0 commit comments