refactor CRLF

Close #851
refactor add trailing newlines

Close #851