Reverse paragraphs before fixing up trailing whitespace

This avoids the regex engine having to scan the entire string.