Repace trailing-newlines with surrounding-whitespace