The POSIX standard for text files is that each line is "A sequence of zero or more non-\<newline> characters plus a terminating \<newline> character". Files output by svgcleaner currently don't contain a newline character (\n) at the end of the file, which breaks displaying the file with cat or similar in terminals, and shows warnings elsewhere (including GitHub).
My proposal is to add a setting to append newlines to the end of each file. This adds exactly one byte to every file, so it makes sense to be disabled by default, due to the purpose of svgcleaner being to absolutely minify the SVG, yet allowing this would be great to avoid warnings and potential issues. This would probably go under the "Output" section of the --help page.
The POSIX standard for text files is that each line is "A sequence of zero or more non-\<newline> characters plus a terminating \<newline> character". Files output by svgcleaner currently don't contain a newline character (
\n
) at the end of the file, which breaks displaying the file withcat
or similar in terminals, and shows warnings elsewhere (including GitHub).For more information, check out this StackOverflow question: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
My proposal is to add a setting to append newlines to the end of each file. This adds exactly one byte to every file, so it makes sense to be disabled by default, due to the purpose of svgcleaner being to absolutely minify the SVG, yet allowing this would be great to avoid warnings and potential issues. This would probably go under the "Output" section of the
--help
page.