Remove EOL white spaces before writing, except for markdown files