Fix #13233: re-allow .replaceWith of text nodes. Close gh-1137.