-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Viewer does not support full SVG 1.1" added to image during optimization #1410
Comments
Hi, could you please submit svg file here? |
Alright, I see the problem |
Good deal - do you still need that SVG file? |
You can submit one in case service will be unavailable |
If useful, here is SVG with the problem: https://raw.githubusercontent.com/vincentbernat/vincent.bernat.ch/fcdf778c74bd9717552e323abaef2a73982c5d8a/content/media/images/rsync-remote-remote.svg |
For anyone else hitting this problem: draw.io graphs are generated with this piece of code: <switch>
<g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/>
<a transform="translate(0,-5)" xlink:href="[https://www.diagrams.net/doc/faq/svg-export-text-problems](view-source:https://www.diagrams.net/doc/faq/svg-export-text-problems)" target="_blank">
<text text-anchor="middle" font-size="10px" x="50%" y="100%">Viewer does not support full SVG 1.1</text>
</a>
</switch> And SVGO's The workaround, until that plugin deals with this case, is to disable it through config. I.e.: module.exports = {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeEmptyContainers: false,
},
},
},
],
}; |
This seems easy to fix: check if parentNode tag is switch and don't remove the container if it is. |
Thanks for investigating this and opening a PR. I'll review it soon and get it merged. I was checking if we should really skip if the parent is a Indeed, I think the best solution is to check if the parent is a It could also be worth updating Remove Hidden Elements to delete the |
Describe the bug
When I run an SVG 1.1 document through svgo (version 2.2.1 installed via
yarn global
), I get the text "Viewer does not support full SVG 1.1" added to the bottom of the image. I don't see anything else wrong with the image. Checking the output SVG source shows that the text is added by svgo, not the viewer.To Reproduce
Steps to reproduce the behavior:
svgo my.svg -o my2.svg
Expected behavior
Assuming that the warning is legitimate, I would expect it to either appear on stdout or else to fail processing and be on stderr. Showing up silently on the output image was unexpected.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: