diff options
| -rw-r--r-- | imagemap.py | 6 | ||||
| -rw-r--r-- | tests/data/refs/imagemap__--maptype__HTML__overlap__svg.out | 2 | ||||
| -rw-r--r-- | tests/data/svg/overlap.svg | 2 |
3 files changed, 6 insertions, 4 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() diff --git a/tests/data/refs/imagemap__--maptype__HTML__overlap__svg.out b/tests/data/refs/imagemap__--maptype__HTML__overlap__svg.out index de38166..5f36bd7 100644 --- a/tests/data/refs/imagemap__--maptype__HTML__overlap__svg.out +++ b/tests/data/refs/imagemap__--maptype__HTML__overlap__svg.out @@ -1,4 +1,4 @@ <area shape=poly coords=30,10,30,30,40,30,40,20,80,20,80,60,70,60,70,70,90,70,90,10 href=http://example.com/1> <area shape=poly coords=30,40,30,70,60,70,60,60,40,60,40,40 href=http://example.com/1> <area shape=rect coords=20,40,60,80> -<area shape=rect coords=10,30,70,90 href=http://example.com/2> +<area shape=rect coords=10,30,70,90 href=http://example.com/2 alt=blue> diff --git a/tests/data/svg/overlap.svg b/tests/data/svg/overlap.svg index 7a3e7aa..8e01282 100644 --- a/tests/data/svg/overlap.svg +++ b/tests/data/svg/overlap.svg @@ -2,7 +2,7 @@ <a xlink:href="http://example.com/1"> <rect x="35" y="15" width="50" height="50" stroke="red"/> </a> - <a xlink:href="http://example.com/2"> + <a xlink:href="http://example.com/2" xlink:title="blue"> <rect x="15" y="35" width="50" height="50" stroke="blue"/> </a> </svg> |
