gulp-concat-css
gulp-concat-css copied to clipboard
Quotes are removed in data uri during concatenation
Hi,
I've just encontered a bug during concatenation of files containing inlined SVG
div {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='32' height='24' viewBox='0 0 32 24'><polygon points='0,0 32,0 16,24' style='fill: rgb%2851, 51, 51%29'></polygon></svg>");
}
produces
div {
background-image: url("data:image/svg+xml;utf8,<svg xmlns=http://www.w3.org/2000/svg version=1.1 width=32 height=24 viewBox=0 0 32 24><polygon points=0,0 32,0 16,24 style=fill: rgb%2851, 51, 51%29></polygon></svg>");
}
You'll notice that all single quotes are removed after concatenation, which results in bad SVG. Same problem appears with double quotes.
This problem disappears when I use the option rebaseUrls : false
. Is this the correct behavior ?
When using base64 encoded resource, there is no problem.
I'm using gulp-concat-css 2.2.0
This bug seems to still be ongoing even with version 3.0
So what are any other options? Is this going to be fixed?
Ran into the same issue. Problem is within the rework-plugin-url
package: https://github.com/reworkcss/rework-plugin-url/issues/7
I lost several hours today trying to find what happened with my svg background images.
This should have been solved since many years.
Still not fixed which is why I need to switch to gulp-concat then :/