Resolve text shift with replaceInText