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.
I ran into this issue as well and found a workaround.
Using plantuml.1.2023.7
and the options below fixes the issue:
.. uml::
:html_format: png
:latex_format: png
FYI my conf.py contains:
plantuml_output_format = 'svg_img'
plantuml_latex_output_format = 'pdf'
Because it's annoying to specify the png format every time and because ditaa prints skinparam
commands, passed via plantuml -I stylesheet.skinparam
, at the start of the png, I decided to use sphinxcontrib-ditaa and install ditaa standalone.
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: