From 274ad4460f3f4a35e099545a1a8408a9a67614e1 Mon Sep 17 00:00:00 2001 From: Viatrix Date: Wed, 18 Mar 2026 10:02:22 -0700 Subject: Fixed ALT attribute showing up on s with no HREF. --- imagemap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'imagemap.py') diff --git a/imagemap.py b/imagemap.py index 42c1d4a..a3f6490 100644 --- a/imagemap.py +++ b/imagemap.py @@ -157,10 +157,12 @@ class ImageMap(inkex.OutputExtension): if len(shapes[i])==0: inkex.errormsg(_("The hyperlink \"{}\" could not be added to the output.").format(links[i]['href'])) for j in shapes[i]: attrs=links[i].copy() - attrs['alt']=alt attrs.update(j) + if attrs['href'] is not None: + attrs['alt']=alt + alt=None + else: attrs['alt']=None stream.write(bytes(shapemarkup(attrs),'utf-8')) - alt=None if __name__ == "__main__": ImageMap().run() -- cgit