vscode-svg2
vscode-svg2 copied to clipboard
Minify breaks events in begin attribute
The following input has two animations that trigger each other via the begin attribute.
<ellipse id="demo" cx="11.999911" cy="4" rx="4" ry="4" /> <animateTransform xlink:href="#demo" type="scale" id="a" attributeName="transform" begin="0s;b.end" dur="1s" from="1,1" to="1,0.5" /> <animateTransform xlink:href="#demo" type="scale" id="b" attributeName="transform" begin="a.end" dur="1s" from="1,0.5" to="1,1" />
This is the minified code which has broken references in the begin attribute -> hence a broken animation.
<circle id="prefix__a" cx="12" cy="4" r="4" /> <animateTransform xlink:href="#prefix__a" type="scale" id="prefix__c" attributeName="transform" begin="0s;b.end" dur="1s" from="1,1" to="1,0.5" /> <animateTransform xlink:href="#prefix__a" type="scale" id="prefix__b" attributeName="transform" begin="c.end" dur="1s" from="1,0.5" to="1,1" />
Is this the correct repo to post this kind of issues? The VS-Code Marketplace suggests, that this svg extension uses another library for minifying.
At present, I have not found a better replacement for minified operations. If you know there is, please share it.
If it's SVGO doing the minifying, isn't it just an issue of adding a svgo.config.js (to the workspace) with options to preserve certain things, like id's and attributes.
I almost always add an svgo,config.js that preserves the viewBox attribute for example.
svgo config can be setting by svg.minify
in your vscode settings.