Open oharboe opened 3 years ago
A quick and dirty workaround for poisoned .svg files containing .png data.
def _get_svg_obj_tag(self, fnames, node):
refname, outfname = fnames['svg']
# copy width/height style from <svg> tag, so that <object> area
# has enough space.
try:
_get_svg_style(outfname)
except Exception:
# quick and dirty fallback to using image tag when a non-svg file was generated with a .svg extension
return _get_svg_img_tag(self, fnames, node)
return ('<object data="%s" type="image/svg+xml" style="%s"></object>' %
(self.encode(refname), _get_svg_style(outfname) or ''))
Hi, I'm currently facing this issue as well but I don't have the possibility to implement this quickfix. Could this be fixed in the extension?
What caused the issue specifically in my case was the inclusion of ditaa diagrams:
.. uml::
@startuml
ditaa(--no-shadows,--no-separation)
+-------------------------------------+
| +-------------------------------+ |
o--+->| &BLABLA.123456790123456789012 | |
+-------------------------------+ |
| BLABLABLABLA | |
+-------------------------------+ |
| BLABLABLABLABLABLAB | |
+-------------------------------+ |
| BLA | |
+-------------------------------+ |
| BLABLABLAB +--+
+-------------------------------+
@enduml
Removing all ditaa diagrams from the documentation resolved the issue for me.
This is with sphinxcontrib-plantuml 0.20.1.
Problem: plantuml.jar will silently fall back to .jar files. This can cause exceptions in sphinxcontrib-plantuml.
Example of silent fallback to png in plantuml: