Merge close spans together