OK, so you are wanting the blank lines in the middle removed, which is not what the Trim Whitespace does (it removes white space from either end of the string.
Use a Search and Replace action, with regex \R+ and replace \n and that will replace any sequence of one or more line endings with a single linefeed.