-
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
Enable svgo removeXMLNS plugin by default #9
Comments
While it's safe, I think I'd prefer no-plugins by default, and allow people to opt-in to plugins they want. |
How come? svgo has a lot of plugins enabled by default, and this proposal simply extends that to also include a plugin that is guaranteed to always be applicable in this situation. |
I just personally prefer having it be a cleaner zero-opinion pass-through to SVGO. |
I've changed my mind on this, I think having sane defaults included in the plugin would be great. |
Sounds great!, I've added manually all the svgo default plugins and my |
@emartini can you share your configuration here? |
["inline-react-svg", {
"svgo": {
"plugins": [
{ "cleanupAttrs": true },
{ "removeDoctype": true },
{ "removeXMLProcInst": true },
{ "removeComments": true },
{ "removeMetadata": true },
{ "removeDesc": true },
{ "removeUselessDefs": true },
{ "removeEditorsNSData": true },
{ "removeEmptyAttrs": true },
{ "removeHiddenElems": true },
{ "removeEmptyText": true },
{ "removeEmptyContainers": true },
{ "cleanupEnableBackground": true },
{ "minifyStyles": true },
{ "convertStyleToAttrs": true },
{ "convertColors": true },
{ "convertPathData": true },
{ "convertTransform": true },
{ "removeUnknownsAndDefaults": true },
{ "removeNonInheritableGroupAttrs": true },
{ "removeUselessStrokeAndFill": true },
{ "removeUnusedNS": true },
{ "cleanupIDs": true },
{ "cleanupNumericValues": true },
{ "cleanupListOfValues": true },
{ "moveElemsAttrsToGroup": true },
{ "moveGroupAttrsToElems": true },
{ "collapseGroups": true },
{ "mergePaths": true },
{ "convertShapeToPath": true },
{ "removeXMLNS": true },
]
}
}] The only non default option is |
This plugin removes the
xmlns
attribute from the top-level svg element, which is safe for inline SVGs, which is how all SVGs transformed by this plugin will end up being used. I think it makes sense to enable this plugin by default.https://github.com/svg/svgo/blob/master/plugins/removeXMLNS.js
The text was updated successfully, but these errors were encountered: