Open tbouffard opened 4 years ago
With 9484c99a (0.1.5-dev), we see that in case of unsupported foreign object, the label is replaced by [Object]
Note
mxImageExport
backed by a mxSvgCanvas2D
(inspired from the draw.io svg exporter implementation)For instance, with Inkscape 1.0 (at least on Ubuntu), the exported svg (see zipped svg master_9484c99a_A.2.0.zip) is rendered as in the following
The svg exporter used to generate the svg presented here doesn't customize mxSvgCanvas2D
foreignObject generation.
By default, mxSvgCanvas2D
generate a [Object]
text label as alternative for viewers that don't support the foreingObject. We could at least use an implementation that display the right text label instead (with the risk of text overflow)
See https://github.com/jgraph/mxgraph/blob/v4.1.1/javascript/src/js/util/mxSvgCanvas2D.js#L363
[Object]
by defaultdraw.io article about issues that may be introduced by html labels: https://www.diagrams.net/doc/faq/svg-export-text-problems (or legacy https://desk.draw.io/support/solutions/articles/16000042487)
As of #299, we have switched to html labels as mxGraph 4.1.0 only supports wrapping out of the box with such labels.
As mention in the mxGraph documentation:
Enabling HTML labels carries a possible security risk (see the section on security in the manual).
This could also cause issue if we want to export the graph in svg (is html in svg foreign object correctly rendered by all svg viewer/editor?), as requested for #133Using svg labels, wrapping could be done with svg text/tspan