Skip to content

Commit 353685a

Browse files
committed
strip some attributes
1 parent 91e5a08 commit 353685a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

svgpath/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ def scale(width, height, viewBox, z):
514514

515515
paths = []
516516

517-
width = sizeFromString(svg.attrib['width'])
518-
height = sizeFromString(svg.attrib['height'])
517+
width = sizeFromString(svg.attrib['width'].strip())
518+
height = sizeFromString(svg.attrib['height'].strip())
519519
try:
520-
viewBox = list(map(float, re.split(r'[\s,]+', svg.attrib['viewBox'])))
520+
viewBox = list(map(float, re.split(r'[\s,]+', svg.attrib['viewBox'].strip())))
521521
except KeyError:
522522
viewBox = [0, 0, width*96/25.4, height*96/25.4]
523523

0 commit comments

Comments
 (0)