1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Description: Fix stylesheet detection in CssCompressor with bs4 4.13
This change should deal with the fact that with beautifulsoup 4.13.0 the
values of a tag attribute are now represented by a list.
.
I'm keeping the lowercasing strategy intact, since it allows matching of
non-lowercase stylesheet representations.
.
This change is likely incomplete and requires further thought.
Closes: #1279
Author: Martin Weinelt <hexa@darmstadt.ccc.de>
Origin: upstream, https://github.com/django-compressor/django-compressor/pull/1285
Last-Update: 2025-03-10
--- python-django-compressor-4.5.1.orig/compressor/css.py
+++ python-django-compressor-4.5.1/compressor/css.py
@@ -17,7 +17,7 @@ class CssCompressor(Compressor):
if (
elem_name == "link"
and "rel" in elem_attribs
- and elem_attribs["rel"].lower() == "stylesheet"
+ and "stylesheet" in elem_attribs["rel"]
):
basename = self.get_basename(elem_attribs["href"])
filename = self.get_filename(basename)
|