Make sure that fragments containing options aren't cached.
[jquery.git] / src / manipulation.js
index 6f0373d..e673e2f 100644 (file)
@@ -4,8 +4,8 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
        rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
        rtagName = /<([\w:]+)/,
        rtbody = /<tbody/i,
-       rhtml = /<|&\w+;/,
-       rnocache = /<script|<object|<embed/i,
+       rhtml = /<|&#?\w+;/,
+       rnocache = /<script|<object|<embed|<option/i,
        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
        fcloseTag = function( all, front, tag ) {
                return rselfClosing.test( tag ) ?
@@ -197,7 +197,7 @@ jQuery.fn.extend({
                                // as properties will not be copied (such as the
                                // the name attribute on an input).
                                var html = this.outerHTML, ownerDocument = this.ownerDocument;
-                               if ( !html || jQuery.nodeName( this, "form" ) ) {
+                               if ( !html ) {
                                        var div = ownerDocument.createElement("div");
                                        div.appendChild( this.cloneNode(true) );
                                        html = div.innerHTML;