Remove trailing empty lines from content