darylldoyle / svg-sanitizer

A PHP SVG/XML Sanitizer
GNU General Public License v2.0
454 stars 67 forks source link

Add a little bit more whitespace removal by trimming. #83

Open rodrigoaguilera opened 1 year ago

rodrigoaguilera commented 1 year ago

When a svg with whitespaces or linebreaks at the end is passed those are preserved. I thought it would be better to remove them

rodrigoaguilera commented 1 year ago

I forgot to mention that when you sanitize a file with no newline at the end the process adds an unnecessary newline to the output. I think is a bug in libxml.

For me this generates a diff between the sanitized and unsanitized version of the file that I hope it can be solved upstream.