Closed enboig closed 2 years ago
Thanks for letting me know about this issue. Unfortunately I cannot fix this issue since it is a bug in plantUML server.
We had a similar issue with math formulas and you can use the same workaround to render properly this type of diagrams:
In few words, you just need to change in the plugin options the rendering mode to png.
I updated the Readme of this project to include those two known issues.
Thanks for your answer. So the public server gives a different response (svg or png) depending on the input? Couldn't the plugin get the mime-type of the response to adapt? I prefer vector images when possible. Another option could be to specify rendering format for each input; maybe a
```plantuml+svg
```plantuml+png
I checked https://github.com/plantuml/plantuml/blob/master/src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java and it appear it don't throw any error, it just always send back a PNG file.
You are right, the output is a PNG image (example).
But the content-type is not image/png
but image/svg+xml
:
If you open the link with the browser it will not work because it is trying to parse it as xml even if it is a PNG.
I need to find a way to understand what is the real type of the response since I cannot rely on the response header or the request I do.
I suppose the content-type is set depending only on the url of the call. Can you check the conten-type of the response data (not the response itself)? By the way, I don't know if joplin plugin system provides a way to pass a parameter to the plugin "per call"; so PNG or SVG could be specified for each graph.
I may found a solution. I'm now checking the response body to look for magic numbers of PNG images. You will find this fix in version 1.8.0 of this plugin.
do you think, the feature to select the rendering type for each diagram (plantuml+svg, plantuml+png), it is still needed?
do you see some use cases when it could be useful?
I don't think selecting rendering type for each diagram is necessary any more; I will choose SVG at plugin; and for a few cases of PNG ones the plugin is handling it.
Thanks for your job (and time!)
When introducing
Image is not rendered, it show the PNG raw image in note; I took the example from https://plantuml.com/ditaa; should the code be updated?