File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
3434 rinlinejQuery = / j Q u e r y \d + = " (?: n u l l | \d + ) " / g,
3535 rnoshimcache = new RegExp ( "<(?:" + nodeNames + ")[\\s/>]" , "i" ) ,
3636 rleadingWhitespace = / ^ \s + / ,
37- rxhtmlTag = / < (? ! a r e a | b r | c o l | e m b e d | h r | i m g | i n p u t | l i n k | m e t a | p a r a m ) ( ( [ \w : ] + ) [ ^ > ] * ) \/ > / gi,
38- rtagName = / < ( [ \w : ] + ) / ,
37+ rxhtmlTag = / < (? ! a r e a | b r | c o l | e m b e d | h r | i m g | i n p u t | l i n k | m e t a | p a r a m ) ( ( [ \w : - ] + ) [ ^ > ] * ) \/ > / gi,
38+ rtagName = / < ( [ \w : - ] + ) / ,
3939 rhtml = / < | & # ? \w + ; / ,
4040 rnoInnerhtml = / < (?: s c r i p t | s t y l e | l i n k ) / i,
4141 // checked="checked" or checked
Original file line number Diff line number Diff line change @@ -527,6 +527,23 @@ test( "html(String) with HTML5 (Bug #6485)", function() {
527527 equal ( jQuery ( "#qunit-fixture" ) . children ( ) . children ( ) . children ( ) . length , 1 , "Make sure nested HTML5 elements can hold children." ) ;
528528} ) ;
529529
530+ test ( "html(String) tag-hyphenated elements (Bug #1987)" , function ( ) {
531+
532+ expect ( 27 ) ;
533+
534+ jQuery . each ( "thead tbody tfoot colgroup caption tr th td" . split ( " " ) , function ( i , name ) {
535+ var j = jQuery ( "<" + name + "-d></" + name + "-d><" + name + "-d></" + name + "-d>" ) ;
536+ ok ( j [ 0 ] , "Create a tag-hyphenated element" ) ;
537+ ok ( jQuery . nodeName ( j [ 0 ] , name . toUpperCase ( ) + "-D" ) , "Hyphenated node name" ) ;
538+ ok ( jQuery . nodeName ( j [ 1 ] , name . toUpperCase ( ) + "-D" ) , "Hyphenated node name" ) ;
539+ } ) ;
540+
541+ var j = jQuery ( "<tr-multiple-hyphens><td-with-hyphen>text</td-with-hyphen></tr-multiple-hyphens>" ) ;
542+ ok ( jQuery . nodeName ( j [ 0 ] , "TR-MULTIPLE-HYPHENS" ) , "Tags with multiple hypens" ) ;
543+ ok ( jQuery . nodeName ( j . children ( ) [ 0 ] , "TD-WITH-HYPHEN" ) , "Tags with multiple hypens" ) ;
544+ equal ( j . children ( ) . text ( ) , "text" , "Tags with multple hypens behave normally" ) ;
545+ } ) ;
546+
530547test ( "IE8 serialization bug" , function ( ) {
531548
532549 expect ( 2 ) ;
You can’t perform that action at this time.
0 commit comments