Closed Cathaiste closed 5 years ago
I believe svg-react-loader
supports filtering these kind of things out using query params. You should be able to use them inline now, though this plugin should probably also support passing along options to svg-react-loader. It currently does not.
@jacobmischka I am having the same issue, but with another "prop"; lineSpacing
. I've found one instance of line-spacing
inside the svg code, is this what's causing it? If so, how do I use svg-react-loader's query params to fix it?
I don't believe line-spacing
is a valid svg attribute, I think that's the fundamental cause of the problem. By default svg-react-loader
converts most snake-case
props to camelCase
to please react, but that doesn't help much in this case since I don't believe either are valid.
You should be able to write your own filter to strip that attribute out if you're so inclined (https://github.com/jhamlet/svg-react-loader#filters), or it might be easier to just remove the attribute from the source SVG.
+1
EDIT: thanks for the thumbs down. 🤷♂️
Hi @jacobmischka I think I have a WIP of a solution to this problem.
In #15 I have updated the plugin config to allow a user to pass in filters
directly, this will be applied to the correct place in the webpack 2 use config.
I moved some things around to allow webpack to work properly with the ...ruleProps spread.
I added a new config value called omitKeys
because I found the filters config to be complex and I felt that end users would be better served with a simple array, the filters
key is left in place as well so anyone else can write their own filters.
I made the PR WIP
because I have not spent a ton of time testing it.
Let me know what you think.
Cheers
Thanks again! :tada:
Hi, it's me again,
Appears that using the plugin launch warnings in the console as you can see here: I think this kind of warning were launch because of xml syntax like "xmlns:cc", "rdf:resource", etc...
So, is it possible to stop these warning still using the plugin or not ?
gatsby -v : 1.1.58