core/text: fix input type in `replace`