We don't do end of line comments, move them above.
[jquery.git] / src / manipulation.js
index 00e3120..99d51a8 100644 (file)
@@ -7,7 +7,8 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
        rtbody = /<tbody/i,
        rhtml = /<|&#?\w+;/,
        rnocache = /<(?:script|object|embed|option|style)/i,
-       rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
+       // checked="checked" or checked (html5)
+       rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
        raction = /\=([^="'>\s]+\/)>/g,
        wrapMap = {
                option: [ 1, "<select multiple='multiple'>", "</select>" ],
@@ -248,10 +249,8 @@ jQuery.fn.extend({
 
                } else if ( jQuery.isFunction( value ) ) {
                        this.each(function(i){
-                               var self = jQuery(this), old = self.html();
-                               self.empty().append(function(){
-                                       return value.call( this, i, old );
-                               });
+                               var self = jQuery(this);
+                               self.html( value.call(this, i, self.html()) );
                        });
 
                } else {