Handle the case of an empty string. Fixes #13401

This will fix .replaceWith() when you pass an empty string.