Fix implementation of resetting currentState to text after inline image.