Skip to content

Commit 868f046

Browse files
author
quantra
committed
bugfix: svg dimension regex no longer replaces "."
1 parent 5b38129 commit 868f046

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lazy_srcset/templatetags/lazy_srcset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def get_svg_dimensions(svg_file):
5050
pass
5151

5252
# These could include units E.g. px or pt so strip them out.
53-
width = re.sub("\\D", "", width) if width is not None else None
54-
height = re.sub("\\D", "", height) if height is not None else None
53+
width = re.sub(r"[^\d.]", "", width) if width is not None else None
54+
height = re.sub(r"[^\d.]", "", height) if height is not None else None
5555

5656
return width, height
5757

0 commit comments

Comments
 (0)