Issue with replaceWith() and conditional functions.

Issue with replaceWith() and conditional functions.

I'm not sure if this is considered a bug or expected behavior but just in case can you take a peak at this StackOverflow question and letting me know if it is or isn't?   Thank you.