Turn formatText into a generator