zicht / htmldev-bundle

Library - Easy living styleguides with Symfony and Twig
MIT License
4 stars 1 forks source link

Do not add XML declaration to inline SVGs #64

Closed 7ochem closed 3 years ago

7ochem commented 3 years ago

The XML declaration (<?xml version="1.0"?>) was added by DOMDocument::saveXML(). SVGs should contain this XML declaration as the first line of the file, but inline SVGs should not as this results in <?xml version="1.0"?> lines everywhere within an HTML document.

Saving the node of the XML SVG document instead of the whole document, results in the same output but without the XML declaration line.