]> source.dussan.org Git - jquery.git/commitdiff
Fixes #13200 - innerHTML in buildFragment need end tags
authorOleg <markelog@gmail.com>
Sun, 13 Jan 2013 17:59:22 +0000 (21:59 +0400)
committerDave Methvin <dave.methvin@gmail.com>
Mon, 14 Jan 2013 03:05:37 +0000 (22:05 -0500)
src/manipulation.js

index 66aa1984d9943f94b01a96705a113d5ba445c910..625baafe01bac8e8de1971e763f700d4328767c2 100644 (file)
@@ -11,11 +11,11 @@ var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>
        wrapMap = {
 
                // Support: IE 9
-               option: [ 1, "<select multiple='multiple'>" ],
+               option: [ 1, "<select multiple='multiple'>", "</select>" ],
 
-               tr: [ 1, "<table>" ],
-               td: [ 3, "<table><tbody><tr>" ],
-               _default: [ 0, "" ]
+               tr: [ 1, "<table>", "</table>" ],
+               td: [ 3, "<table><tr>", "</tr></table>" ],
+               _default: [ 0, "", "" ]
        };
 
 // Support: IE 9
@@ -448,7 +448,7 @@ jQuery.extend({
                                        // Deserialize a standard representation
                                        tag = ( rtagName.exec( elem ) || ["", ""] )[ 1 ].toLowerCase();
                                        wrap = wrapMap[ tag ] || wrapMap._default;
-                                       tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" );
+                                       tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
 
                                        // Descend through wrappers to the right content
                                        j = wrap[ 0 ];