The String Trimming action will remove trailing cr/lf’s if Trim Right or Trim Left/Right is selected. If you have trailing spaces you want to keep then you will need to use the Text Find/Replace action, set the search string to something like (this will remove leading and trailing line breaks).
^[\r\n]+|\.|[\r\n]+$
and check the “Match as regular expression” checkbox, on the Replace tab set to “Replace text and write back to variable” and leave the replacement string blank.