Skip to content

Commit

Permalink
Handle quotes in url(…) syntax
Browse files Browse the repository at this point in the history
Related to #1485
  • Loading branch information
liZe committed Nov 4, 2021
1 parent dbec957 commit 313a4cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions weasyprint/svg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ def parse_url(url):
"""Parse a URL, possibly in a "url(…)" string."""
if url and url.startswith('url(') and url.endswith(')'):
url = url[4:-1]
if len(url) >= 2:
for quote in '\'"':
if url[0] == url[-1]:
url = url[1:-1]
break
return urlparse(url or '')


Expand Down

0 comments on commit 313a4cb

Please sign in to comment.