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

Quotes are removed in data uri during concatenation #31

Open
BboyKeen opened this issue Dec 28, 2015 · 5 comments
Open

Quotes are removed in data uri during concatenation #31

BboyKeen opened this issue Dec 28, 2015 · 5 comments

Comments

@BboyKeen
Copy link

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
Copy link

This bug seems to still be ongoing even with version 3.0

@adardesign
Copy link

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

@xsonic
Copy link

xsonic commented Aug 16, 2018

Ran into the same issue. Problem is within the rework-plugin-url package: reworkcss/rework-plugin-url#7

@migliori
Copy link

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

This should have been solved since many years.

@Syalas
Copy link

Syalas commented Apr 13, 2022

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

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

No branches or pull requests

7 participants