tweaked attributed text replacement