Calling cleanupFormattingGap should not make a copy of the attributes because it needs to be able to update them.