]> source.dussan.org Git - jquery.git/commitdiff
Replace unknown, mysterious html arg to replaceWith(fn...), with just the current...
authorRick Waldron <waldron.rick@gmail.com>
Tue, 16 Oct 2012 19:01:59 +0000 (15:01 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Tue, 16 Oct 2012 19:01:59 +0000 (15:01 -0400)
src/manipulation.js

index aced4567b9c08983c003243411ec0dcc2a29b4e0..5734b33d91b759c08679735f47222e0f6b0f698a 100644 (file)
@@ -263,9 +263,12 @@ jQuery.fn.extend({
                        // Make sure that the elements are removed from the DOM before they are inserted
                        // this can help fix replacing a parent with child elements
                        if ( jQuery.isFunction( value ) ) {
-                               return this.each(function(i) {
-                                       var self = jQuery(this), old = self.html();
-                                       self.replaceWith( value.call( this, i, old ) );
+                               return this.each(function( index ) {
+          // HTML argument replaced by "this" element
+          // 1. There were no supporting tests
+          // 2. There was no internal code relying on this
+          // 3. There was no documentation of an html argument
+                                       jQuery( this ).replaceWith( value.call( this, index, this ) );
                                });
                        }