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
xml parsing error in svg image url after compression #910
Comments
I can confirm this is still happening, despite the changes in #828 I'm using Django 2.0, Python 3.6, django-compressor 2.2, Bootstrap 4.1.1 The problem is caused by |
Borrowing from a workaround for csscompressor, I added a custom filter to wrap rcssmin (replace CSSMinFilter in settings.COMPRESS_FILTERS with the dotted path string to this filter and change the def compress(css, **kwargs):
capture_svg = re.compile(r'url\("(data:image/svg.*?svg%3[Ee])\"\)')
data_urls = re.findall(capture_svg, css)
for data_url in data_urls:
css = css.replace(data_url, data_url.replace(' ', '%20'))
css = cssmin(css, **kwargs)
return css
class CSSMinFilter(CallbackOutputFilter):
callback = 'myapp.core.utils.compress' This issue has also been reported to rcssmin. FYI, this issue appears to be a duplicate of #878. |
Can this be closed now that rccsmin==1.1.0 is the default CSS filter and the upstream issue has been fixed? |
Yes, thanks for flagging. |
I have compressed bootstrap.min.js using django_compressor
the navbar collapse icon is not rendering due to XML parsing error.
I am using bootstrap4, I didn't face such problem with bootstrap3
i saw the difference using inspect element in firefox
No error (without compression)
this gives XML error (after compression)
The text was updated successfully, but these errors were encountered: