jakearchibald / svgomg

Web GUI for SVGO
https://jakearchibald.github.io/svgomg/
MIT License
5.8k stars 483 forks source link

"Inline styles" removes `<symbol>` elements #417

Open nhoizey opened 1 year ago

nhoizey commented 1 year ago

I'm trying to optimize the logo available here: https://nicolas-hoizey.photo/ui/logo.svg

"Inline styles" is active by default, so it should be pretty safe, but it removes the <symbol> elements and their contents:

CleanShot 2022-12-13 at 11 49 09

I don't know if it's a bug in SVGO or SVGOMG. I couldn't find a relevant issue or PR in SVGO's repository.

nhoizey commented 1 year ago

It looks like it's an issue in SVGO directly. I tried with SVGO CLI, and it also removes the <symbol>s.

It doesn't with this configuration removing the inlineStyles plugin:

module.exports = {
  plugins: [
    {
      name: 'preset-default',
      params: {
        overrides: {
          inlineStyles: false,
        },
      },
    },
  ],
};

I'll open an issue on SVGO and link it here.

Should I keep this one open?