Skip to content
Permalink
Browse files

Fix #13818: Add wrapMap entry for col element

  • Loading branch information...
markelog committed Apr 24, 2013
1 parent 78c803f commit 3a6194076b8b7ab5a9d9f5e6ec602db2ab427d3e
Showing with 16 additions and 1 deletion.
  1. +2 −1 src/manipulation.js
  2. +14 −0 test/unit/manipulation.js
@@ -16,6 +16,7 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
option: [ 1, "<select multiple='multiple'>", "</select>" ],

thead: [ 1, "<table>", "</table>" ],
col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],

@@ -25,7 +26,7 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
// Support: IE 9
wrapMap.optgroup = wrapMap.option;

wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.col = wrapMap.thead;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;

jQuery.fn.extend({
@@ -2105,3 +2105,17 @@ test( "Make sure specific elements with content created correctly (#13232)", 20,
ok( jQuery.nodeName( this, results[ i ] ) );
});
});

test( "Validate creation of multiple quantities of certain elements (#13818)", 44, function() {
var tags = [ "thead", "tbody", "tfoot", "colgroup", "col", "caption", "tr", "th", "td", "optgroup", "option" ];

jQuery.each( tags, function( index, tag ) {
jQuery( "<" + tag + "/><" + tag + "/>" ).each(function() {
ok( jQuery.nodeName( this, tag ), tag + " empty elements created correctly" );
});

jQuery( "<" + this + "></" + tag + "><" + tag + "></" + tag + ">" ).each(function() {
ok( jQuery.nodeName( this, tag ), tag + " elements with closing tag created correctly" );
});
});
});

0 comments on commit 3a61940

Please sign in to comment.
You can’t perform that action at this time.