Fix text range styling.
Bug caused by 3f633c9d .
Searching for iterator in a copy of string doesn't work.
Unnecessary string copies from passing by value should be avoid anyway. I assume it got accidentally included during the iterator reference->value changes (copying iterator is cheap).
Closes inbox#12488 (closed)