Prevent residual span from appearing when removing formats