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
Parsing of quoted data URLs can produce wrong quoting in compressor.filters.css_default.CssAbsoluteFilter #878
Comments
looks like a duplicate of #827. the fix is in django-compressor 2.2, please make sure you're using the latest version. if the problem still persist, we'll reopen of course :) |
@karyon I am actually having the same exact issue, and I am using django-compressor 2.2. |
well, shit :) i'll have a look in the coming days hopefully. |
@shezi, @Hybridx24, which version of bootstrap exactly? beta1? |
I am actually using Bootstrap 3.3.6 - but the issue occurs to me when I use my own custom SVG (which works perfectly pre-compression). It seems that like the OP said, something is breaking inside of |
I'm using Bootstrap v4.0.0-alpha.6 and I have the same problem. It'd be nice if you could fix this |
@Hybridx24, @Renatello, please give me your python version, pip freeze output, input css, actual output and expected output. i have pasted the css reported by @shezi into a test and in that test, the CSSAbsoluteFilter does not change it at all. |
Python: 3.6.2 requirements.txt: Input CSS:
Output CSS:
Expected output: |
that compresses just fine for me as well :( could you give me your settings.py, some more context of the css file (ideally the whole one) and the template where you are including this? |
@karyon The css is really just an override next/previous arrow for swiper.js, so the rest of the code is largely irrelevant. All I know is that the CSS works perfectly until I wrap
As for the settings.py:
|
RCSSmin also mangles the same rule from Bootstrap 4, although in a different way than I guess |
re-reading this and #910 it seems to me that the original issue (wrong quoting) has indeed been fixed and the remaining issue (removed whitespace) is described in #910. thanks @Hybridx24, @jsma and @jameysharp. |
For what it's worth I have been running into this same problem when |
@dwasyl was RCSSmin also enabled? can you please paste the output of pip freeze, the input css, actual output and expected output? |
@karyon Sorry, I hadn't gotten back to this project in a little while. I'm using CSSMin, but not RCSSMin. What I'm seeing as my uncompressed value is this: Then, after compression: In settings, I have:
As far as PIP freeze:
|
thanks. that looks indeed like #910. |
I am compressing bootstrap4 with django-compress, and it wrongly quotes one of the svg backgrounds.
It turns this:
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E"); }
into this:
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5")' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E"); }
It's a bit hard to see, but there's an extra
"
inserted inrgba(255, 255, 255, 0.5")
. This extra quoting invalidates most of the CSS that follows (up until another SVG background inserts another quote, re-starting CSS rules).One workaround is to disable
compressor.filters.css_default.CssAbsoluteFilter
.This issue could be related to #485
The text was updated successfully, but these errors were encountered: