I'd go with
(?<!\S) [download]
so
s/[^\S \n]//g; s/(?<!\S) +| +(?!\S)//g; s/\n\n\K\n+//g; [download]
In reply to Re^6: regexp: removing extra whitespace by ikegami in thread regexp: removing extra whitespace by perlmax