wrapMap.js (823B)
1 define( [ 2 "./support" 3 ], function( support ) { 4 5 "use strict"; 6 7 // We have to close these tags to support XHTML (trac-13200) 8 var wrapMap = { 9 10 // XHTML parsers do not magically insert elements in the 11 // same way that tag soup parsers do. So we cannot shorten 12 // this by omitting <tbody> or other required elements. 13 thead: [ 1, "<table>", "</table>" ], 14 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 15 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 16 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 17 18 _default: [ 0, "", "" ] 19 }; 20 21 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 22 wrapMap.th = wrapMap.td; 23 24 // Support: IE <=9 only 25 if ( !support.option ) { 26 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 27 } 28 29 return wrapMap; 30 } );