mariocasciaro / gulp-concat-css

Concatenates css files, bubbling up import statements (as per the standard), and optionally rebasing urls and inlining local import statements.
MIT License
78 stars 19 forks source link

Quotes are removed in data uri during concatenation #31

Open BboyKeen opened 8 years ago

BboyKeen commented 8 years ago

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

levipage commented 6 years ago

This bug seems to still be ongoing even with version 3.0

adardesign commented 6 years ago

So what are any other options? Is this going to be fixed?

xsonic commented 6 years ago

Ran into the same issue. Problem is within the rework-plugin-url package: https://github.com/reworkcss/rework-plugin-url/issues/7

migliori commented 3 years ago

I lost several hours today trying to find what happened with my svg background images.

This should have been solved since many years.

Syalas commented 2 years ago

Still not fixed which is why I need to switch to gulp-concat then :/