handle trailing newlines after content