Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Kozea/cairosvg
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Feb 7, 2019
2 parents 10748e8 + abab74b commit 23a4b95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cairosvg/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,9 @@ def __init__(self, **kwargs):
else:
raise TypeError(
'No input. Use one of bytestring, file_obj or url.')
if parent and self.url == parent.url:
if parent and (
self.url == parent.url or
(url.startswith('#') and not self.url)):
root_parent = parent
while root_parent.parent:
root_parent = root_parent.parent
Expand Down

0 comments on commit 23a4b95

Please sign in to comment.