Skip to content

Commit

Permalink
Allow relative links in SVG images
Browse files Browse the repository at this point in the history
Fix #1768.
  • Loading branch information
liZe committed Dec 2, 2022
1 parent 9a381f0 commit d689454
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion weasyprint/svg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def get_viewbox(self):
def get_href(self, base_url):
"""Get the href attribute, with or without a namespace."""
for attr_name in ('{http://www.w3.org/1999/xlink}href', 'href'):
url = get_url_attribute(self, attr_name, base_url)
url = get_url_attribute(
self, attr_name, base_url, allow_relative=True)
if url:
return url

Expand Down

0 comments on commit d689454

Please sign in to comment.