-
Notifications
You must be signed in to change notification settings - Fork 94
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
Namespace prefix inkscape for pageopacity on namedview is not defined #25
Comments
Giving up on Inkscape's SVG and going for what they call Standard SVG, results in an error <svg xmlns="http://www.w3.org/2000/svg"><symbol id="icon-access"><title>access</title> <metadata id="44525ed4f3f262f8e7b5d78a1566e05bmetadata3320"> <rdf:rdf> <cc:work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> <dc:title/> </cc:work> </rdf:rdf> </metadata> <g transform="translate(0,-988.36218)" id="44525ed4f3f262f8e7b5d78a1566e05blayer1"> <path d="m 53.808483,1050.3713 -43.429508,0 0,-32.8261 43.429508,0 0,32.8261 z m -6.260221,-35.1727 -0.978409,0 -26.604522,0 0,-0.1591 0,-10.1364 0,-1.9931 c 0,-6.68862 5.440904,-12.12838 12.128398,-12.12838 6.686358,0 12.128399,5.44204 12.128399,12.12838 l 0,1.9931 2.347725,0 0,-1.9931 c 0,-7.98293 -6.493176,-14.47611 -14.476124,-14.47611 -7.982947,0 -14.476124,6.49431 -14.476124,14.47731 l 0,12.2886 -9.586355,0 0,37.5192 48.124959,0 0,-37.5204 -8.607947,0 z" id="44525ed4f3f262f8e7b5d78a1566e05bpath28" style="fill:#1d1d1d;fill-opacity:1;fill-rule:nonzero;stroke:none"/> </g> </symbol><symbol id="icon-exit"><title>exit</title> <metadata id="5f7179d7382a436c2da07e38504e6d57metadata3320"> <rdf:rdf> <cc:work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> <dc:title/> </cc:work> </rdf:rdf> </metadata> <g transform="translate(0,-988.36218)" id="5f7179d7382a436c2da07e38504e6d57layer1"> <g transform="matrix(0.74062091,0,0,0.74062091,14.528,262.00513)" id="5f7179d7382a436c2da07e38504e6d57g3369"> <g transform="matrix(1.25,0,0,-1.25,17.483881,988.80851)" id="5f7179d7382a436c2da07e38504e6d57g62"> <path d="m 0,0 0,-2.358 37.499,0 0,-51.83 -37.499,0 0,-2.355 39.854,0 L 39.854,0 0,0 z" id="5f7179d7382a436c2da07e38504e6d57path64" style="fill:#2f2d2d;fill-opacity:1;fill-rule:nonzero;stroke:none"/> </g> <g transform="matrix(1.25,0,0,-1.25,28.513261,1046.5049)" id="5f7179d7382a436c2da07e38504e6d57g66"> <path d="M 0,0 1.829,-1.829 21.543,17.884 1.829,37.597 0,35.771 16.596,19.177 l -54.962,0 0,-2.584 54.958,0 L 0,0 z" id="5f7179d7382a436c2da07e38504e6d57path68" style="fill:#2f2d2d;fill-opacity:1;fill-rule:nonzero;stroke:none"/> </g> </g> </g> </symbol></svg> |
You have to manually add the appropriate namespace as an attribute in your svgstore config like: svgstore : {
options : {
svg : {
'xmlns:inkscape' : 'http://www.inkscape.org/namespaces/inkscape'
}
}
} As mentioned above you have to add each custom namespace you are using like that. |
Ok, I'll work it out and push you a PR once I have a working solution. Maybe we can auto detect Inkscape's SVG and take over the namespaces automagically. |
Unfortunately it's not so simple. Just pushing the namespaces won't resolve, it's corrupt. Rendered view ends up empty on Safari and in Inkscape itself. |
Yeah I would like an auto detect feature ( not explicitly bound to Inkscape though) it would be possible to collect all attributes (namespace related) and add them to the resulting svg. |
Yup, I was thinking down the same path, shouldn't be limited anyhow. |
If you are just displaying the generated svg it should not display anything on its on. So it is working as intended. Have a look at the |
Very nice, it works! So for Inkscape, a working task configuration needs to look like the following: svgstore: {
options: {
prefix: 'icon-',
includedemo: true,
svg: {
'xmlns:dc': "http://purl.org/dc/elements/1.1/",
'xmlns:cc': "http://creativecommons.org/ns#",
'xmlns:rdf': "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
'xmlns:svg': "http://www.w3.org/2000/svg",
'xmlns': "http://www.w3.org/2000/svg",
'xmlns:sodipodi': "http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",
'xmlns:inkscape': "http://www.inkscape.org/namespaces/inkscape"
}
},
default: {
files: {
'<%= config.app %>/images/svg-defs.svg': ['<%= config.app %>/images/svg/icon/*.svg']
}
},
} |
Thank you so much for this information @ain , I got the same issue using inkscape generated svg and this fixed my problem. |
SVGs created by Inkscape have a following problem once concatenated (from Safari):
1st SVG:
2nd SVG:
Result by
grunt-svgstore
:The text was updated successfully, but these errors were encountered: