OhMySVG icon indicating copy to clipboard operation
OhMySVG copied to clipboard

Potential Feature: XML view

Open snwh opened this issue 2 years ago • 3 comments

While the visual optimization view is nice, it may be worthwhile having a view switcher to allow seeing the markup/xml optimizations as well as the visual.

snwh avatar May 25 '22 14:05 snwh

Do you have a use case in mind?

The point of svgo is to produce small and optimized XML output so I'm not sure that this would be very useful as it'll be unreadable to humans.

sonnyp avatar May 26 '22 15:05 sonnyp

Likely not for large illustrations but of you are designing simple SVG icons for example, which might only be a couple objects, it is useful to see the XML in case there are errors or if the optimization was overly aggressive which may affect how they are displayed on the web or what not.

snwh avatar May 26 '22 18:05 snwh

I think a markup/xml preview could do some basic whitespace formatting. Removing unnecessary whitespace doesn't need to be included in a markup preview because it's such a simple operation. To avoid confusion, a small hint could be added, such as "For readability, the preview does not include whitespace optimization".

zroug avatar Feb 12 '23 16:02 zroug