Open robshep opened 5 years ago
I confirm the issue. Someone has a solution?
Also ran into this, solved it by subclassing CSSRewrite
and overriding rewrite_url
to just returning the matched data if it seems to be a data-url (which doesn't make sense to rewrite anyway):
def rewrite_url(self, m):
url = m.groups()[1]
if url.startswith('data:') or url.startswith('"data:') or url.startswith('\'data:'):
return m.group(0)
else:
return super(FixedCSSRewrite, self).rewrite_url(m)
I can put this into a PR if this is an acceptable solution.
In the default,and with a replace map config, the cssrewrite filter breaks a data uri css url with SVG content.
This particular breakage affecting me is in the css of Bootstrap 4(.1.3)
https://github.com/twbs/bootstrap/blob/v4.1.3/dist/css/bootstrap.css#L4308
original:
Note: I've tried to workaround this, but the replace lambda version only gives me the url to fiddle with, and not the original path, so I'm stuck.