From 66bf98e03d3b86cc99a029d6abd4256a1947fa75 Mon Sep 17 00:00:00 2001 From: Andrzej Witecki Date: Fri, 6 Oct 2023 09:39:02 +0200 Subject: [PATCH] Handle tags with uppercased 'sizes' attr Some web sources contains tags like: ```xml ``` In order to handle them correctly it's necessary to ignore the 'sizes' attribute case while resolving the dimensions --- src/favicon/favicon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/favicon/favicon.py b/src/favicon/favicon.py index 5730f91..aca73e8 100644 --- a/src/favicon/favicon.py +++ b/src/favicon/favicon.py @@ -182,7 +182,7 @@ def dimensions(tag): if sizes and sizes != 'any': size = sizes.split(' ') # '16x16 32x32 64x64' size.sort(reverse=True) - width, height = re.split(r'[x\xd7]', size[0]) + width, height = re.split(r'[x\xd7]', size[0], flags=re.I) else: filename = tag.get('href') or tag.get('content') size = SIZE_RE.search(filename)