diff options
author | Anthony Ryan <anthonyryan1@gmail.com> | 2015-07-25 02:15:02 -0400 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2015-09-14 22:01:04 +0200 |
commit | 99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea (patch) | |
tree | bd1b2f871b3d29e062afe60dc55c61f509cb83ac /src/manipulation/wrapMap.js | |
parent | b5f7c9e2d526b17b9962976bb704dce8779d7362 (diff) | |
download | jquery-99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea.tar.gz jquery-99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea.zip |
Manipulation: Don't provide the parser with sloppy table markup
While we can reply on parsers that were designed to cope with
malformed syntax to understand what we mean, we shouldn't
intentionally provide bad markup, not all parsers will accept
it.
"Be conservative in what you do, be liberal in what you accept
from others."
Reverts 0ea342a6a6dce793c1b0f14f051c2573f40f4e44
Refs gh-2031
Refs gh-2002
Fixes gh-2493
Closes gh-2499
Diffstat (limited to 'src/manipulation/wrapMap.js')
-rw-r--r-- | src/manipulation/wrapMap.js | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/manipulation/wrapMap.js b/src/manipulation/wrapMap.js index a7b913c90..fdb430a03 100644 --- a/src/manipulation/wrapMap.js +++ b/src/manipulation/wrapMap.js @@ -6,20 +6,13 @@ var wrapMap = { // Support: IE9 option: [ 1, "<select multiple='multiple'>", "</select>" ], + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting <tbody> or other required elements. thead: [ 1, "<table>", "</table>" ], - - // Some of the following wrappers are not fully defined, because - // their parent elements (except for "table" element) could be omitted - // since browser parsers are smart enough to auto-insert them - - // Auto-insert "colgroup" element - col: [ 2, "<table>", "</table>" ], - - // Auto-insert "tbody" element - tr: [ 2, "<table>", "</table>" ], - - // Auto-insert "tbody" and "tr" elements - td: [ 3, "<table>", "</table>" ], + col: [ 2, "<table><colgroup>", "</colgroup></table>" ], + tr: [ 2, "<table><tbody>", "</tbody></table>" ], + td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], _default: [ 0, "", "" ] }; |