Fix #13401: replaceWith(""). Close gh-1163.
(cherry picked from commit 6a0ee2d9ed34b81d4ad0662423bf815a3110990f)