Remove trailing white spaces before saving the document.