Issue with replaceWith...

Issue with replaceWith...

Hi,
I recently ran into an issue with the replaceWith function. This function currently does 
this.after( value ).remove();
when it tries to insert the value after the current node there are duplicate elements in the DOM (note the old element hasnt been removed yet). If my new content has any inline script elements that are trying to manipulate the content, then it manipulates the old content in the DOM and not the new content since the old content precedes the new content in the DOM. I would like to propose to change the replaceWith function to do the following
this.before( value ).remove();
This way the new content is always before the old content and then any resulting script will always act on the new content's HTML. Thoughts?

--Gowtham