mikitex70 / plantuml-markdown

PlantUML plugin for Python-Markdown
BSD 2-Clause "Simplified" License
192 stars 55 forks source link

svg not clickable #17

Closed karlssonjohan closed 5 years ago

karlssonjohan commented 5 years ago

It seems that the SVGs generated from plantuml diagrams with links do not produce diagrams with clickable links. I think it has to do with the html tags. Instead of an img tag there must be an object tag in order to make links clickable. Would it be possible to add or change the html tagging for the SVG case?

PlantUML/Markdown code

## link test 
``` plantuml
ref over A,B
link [[http://plantuml.com Hello]]
end ref

This seem to work:
```html
<p>
   <object data="data:image/svg+xml;base64,PD94bWwgdm .......Pg==">
</object>
</p>
mikitex70 commented 5 years ago

The plugin produces images, so it instructs the markdown to insert images. The object tag is not so portable and seems to create troubles in some pages; maybe today a better solution is to use the HTML5 svg tag, but I'm not sure how different versions of Internet Explorer can handle them. I would try to implement both solutions this weekend.

mikitex70 commented 5 years ago

Released version 1.3.0, you can install it through pip. I've added two new formats, svg_object which uses the object tag, and svg_inline which uses the HTML5 svg tag. Thanks for your suggestion.

karlssonjohan commented 5 years ago

Thanks! it seems to work but I think there is a missing closing </object> tag.

mikitex70 commented 5 years ago

The object tag is self-closed, look at the end, there is a />.