Merge pull request #808 from dvschuyl/bug/parse-srcset-fix-float-width
🐛 Truncate width to integer string in srcset
This commit is contained in:
@@ -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
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user