1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-09-11 20:47:56 +03:00

Allow relative links in SVG images

Fix #1768.
This commit is contained in:
Guillaume Ayoub 2022-12-02 21:30:45 +01:00
parent 9a381f0829
commit d689454fd6

View File

@ -178,7 +178,8 @@ class Node:
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