Make sure that .html(Function) gets the correct previous value.
[jquery.git] / src / manipulation.js
index 081bb54..9ed22ba 100644 (file)
@@ -196,6 +196,14 @@ jQuery.fn.extend({
                                this.empty().append( value );
                        }
 
+               } 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 );
+                               });
+                       });
+
                } else {
                        this.empty().append( value );
                }