File: Fix-stylesheet-detection-in-CssComproessor-with-bs4.13.patch

package info (click to toggle)
python-django-compressor 4.5.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,108 kB
  • sloc: python: 4,900; makefile: 123; javascript: 5
file content (24 lines) | stat: -rw-r--r-- 1,079 bytes parent folder | download
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)