Skip to content
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

Inkscape-specific attributes are not removed from groups #983

Open
MartijnCuppens opened this issue Jun 14, 2018 · 1 comment
Open

Inkscape-specific attributes are not removed from groups #983

MartijnCuppens opened this issue Jun 14, 2018 · 1 comment

Comments

@MartijnCuppens
Copy link

Is there a reason why this data

svgo/plugins/_collections.js

Lines 2280 to 2296 in 0835859

exports.editorNamespaces = [
'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd',
'http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd',
'http://www.inkscape.org/namespaces/inkscape',
'http://www.bohemiancoding.com/sketch/ns',
'http://ns.adobe.com/AdobeIllustrator/10.0/',
'http://ns.adobe.com/Graphs/1.0/',
'http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/',
'http://ns.adobe.com/Variables/1.0/',
'http://ns.adobe.com/SaveForWeb/1.0/',
'http://ns.adobe.com/Extensibility/1.0/',
'http://ns.adobe.com/Flows/1.0/',
'http://ns.adobe.com/ImageReplacement/1.0/',
'http://ns.adobe.com/GenericCustomNamespace/1.0/',
'http://ns.adobe.com/XPath/1.0/',
'http://schemas.microsoft.com/visio/2003/SVGExtensions/'
];

is only removed from the svg root?

if (item.isElem('svg')) {
item.eachAttr(function(attr) {
if (attr.prefix === 'xmlns' && editorNamespaces.indexOf(attr.value) > -1) {
prefixes.push(attr.local);
// <svg xmlns:sodipodi="">
item.removeAttr(attr.name);
}
});
}

These attributes are sometimes added to groups like in bootstrap:
https://github.com/twbs/bootstrap/blob/7b2372f35319ce392cb3f6ddab7c2de879a8a354/assets/brand/bootstrap-outline.svg#L2

I think they can also be removed from all other elements?

@XhmikosR
Copy link
Contributor

@TrySound would it be OK just dropping the if (item.isElem('svg')) check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants