You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
svgo has several long standing bugs like #1077. At the same time, svgo project deeply penetrated content processing toolchains like Docusaurus and others. Unfortunately, those toolchains do not provide a straightforward way to configure the svgo instance they use. As the result, some .svg files cannot be used because they always get broken by svgo optimizations.
Proposed Solution
Provide a way to disable svgo with a directive inside an affected .svg file. This can be achieved by introducing a separate XML namespace, like so:
One alternative is to wait for a svgo bug to get fixed. Unfortunately, this may be a slow process without guarantees.
Another alternative is to programmatically configure the svgo instance inside a particular toolchain. Unfortunately, it is often impossible without hacks or patches, as not all toolchains provide a way to programmatically configure the tools they use.
The text was updated successfully, but these errors were encountered:
I don't think this is something that should be handled in SVGO.
There are two scenarios to consider:
Cloud hosts that use SVGO on server-side, users shouldn't have control over the pipeline.
Tooling that uses SVGO to circumvent XSS, like IPX (and thus Nuxt). If the SVG can bypass SVGO by adding the proposed attribute, that would undermine it.
A solution for problems above would be for SVGO to expose an option for whether this attribute was enabled or not, disabled by default. But as you've expressed, a lot of tooling isn't exposing SVGO's configuration, so you wouldn't be able to enable this anyway.
One alternative is to wait for a svgo bug to get fixed.
I'm working actively to address the backlog of issues and pull requests that've been piling up, and already have many bug fixes queued to be released in v3.0.3. As you've highlighted #1077, I can give this one a look next.
Meanwhile, what you've raised with tools not exposing the SVGO config is a real issue. I'll see if I can review Docusaurus afterward and introduce a way to expose SVGO.
Problem
svgo
has several long standing bugs like #1077. At the same time,svgo
project deeply penetrated content processing toolchains like Docusaurus and others. Unfortunately, those toolchains do not provide a straightforward way to configure the svgo instance they use. As the result, some.svg
files cannot be used because they always get broken bysvgo
optimizations.Proposed Solution
Provide a way to disable
svgo
with a directive inside an affected.svg
file. This can be achieved by introducing a separate XML namespace, like so:Alternatives
One alternative is to wait for a svgo bug to get fixed. Unfortunately, this may be a slow process without guarantees.
Another alternative is to programmatically configure the svgo instance inside a particular toolchain. Unfortunately, it is often impossible without hacks or patches, as not all toolchains provide a way to programmatically configure the tools they use.
The text was updated successfully, but these errors were encountered: