🐛 Truncate width to integer string in parse_srcset

This commit is contained in:
dvschuyl
2025-03-11 11:05:14 +01:00
parent e1b3bfe6fb
commit 341b7a5f2a

View File

@@ -48,7 +48,7 @@ def parse_srcset(s: str) -> List[Dict]:
if len(parts) >= 1: if len(parts) >= 1:
url = parts[0] url = parts[0]
width = ( width = (
parts[1].rstrip("w") parts[1].rstrip("w").split('.')[0]
if len(parts) > 1 and parts[1].endswith("w") if len(parts) > 1 and parts[1].endswith("w")
else None else None
) )