The find-and replace highlighting is the right length but in the wrong position (too late among the highlighted characters), because the special characters are not included inside their generated spans and thus not counted when working out the position to highlight.
This is part of #106.