From 6b1b0a26b4d485b4d9f334286efed5dfe33e3f3f Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 16 Jan 2013 12:55:56 -0500 Subject: Fix #13233: re-allow .replaceWith of text nodes. Close gh-1137. --- src/manipulation.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/manipulation.js') diff --git a/src/manipulation.js b/src/manipulation.js index 9f1ecfa7f..34309d0c9 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -269,15 +269,9 @@ jQuery.fn.extend({ var next = this.nextSibling, parent = this.parentNode; - if ( parent && this.nodeType === 1 || this.nodeType === 11 ) { - + if ( parent ) { jQuery( this ).remove(); - - if ( next ) { - next.parentNode.insertBefore( elem, next ); - } else { - parent.appendChild( elem ); - } + parent.insertBefore( elem, next ); } }); }, -- cgit v1.2.3