[lo] text formatter: fix strange bugs with replacements (again)