aboutsummaryrefslogtreecommitdiff
path: root/imagemap.py
diff options
context:
space:
mode:
authorViatrix2026-03-18 10:02:22 -0700
committerViatrix2026-03-18 10:02:22 -0700
commit274ad4460f3f4a35e099545a1a8408a9a67614e1 (patch)
tree37de2d2ea271c77940bc4daee2a90baba9272494 /imagemap.py
parentd3a80223412f8496433305f2cf681df1ac26966f (diff)
Fixed ALT attribute showing up on <AREA>s with no HREF.
Diffstat (limited to 'imagemap.py')
-rw-r--r--imagemap.py6
1 files changed, 4 insertions, 2 deletions
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()