From 3a6194076b8b7ab5a9d9f5e6ec602db2ab427d3e Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 24 Apr 2013 22:15:41 +0400 Subject: [PATCH] Fix #13818: Add wrapMap entry for col element --- src/manipulation.js | 3 ++- test/unit/manipulation.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/manipulation.js b/src/manipulation.js index 6204ca7c9..e323a10ec 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -16,6 +16,7 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^> option: [ 1, "" ], thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], tr: [ 2, "", "
" ], td: [ 3, "", "
" ], @@ -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({ diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index c487efacb..38d38a2b6 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -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 + ">" ).each(function() { + ok( jQuery.nodeName( this, tag ), tag + " elements with closing tag created correctly" ); + }); + }); +});