Questions
What counts as an extra space?
Runs of two or more spaces or tabs collapse to one space, and runs of three or more line breaks collapse to one blank line. Single spaces and deliberate paragraph breaks survive.
Why does pasted text have weird spacing?
Copying from PDFs, emails, and web pages often carries invisible tabs, double spaces, and stray breaks. Cleaning them here beats hunting them by hand.