Forum Feature requests

Support for foreign objects in SVG?

Richard B. Kreckel
I've seen a few feature requests for SVG foreign object support in Prince, but they're all many years old. Also, there's an item on the roadmap.

May I ask what the status regarding this feature is? I'm asking because this is becoming more and more common, for instance in diagrams.net they seem to be using it often (see https://desk.draw.io/support/solutions/articles/16000042487).
mikeday
We will take another look at this feature.
Richard B. Kreckel
Any news yet on foreign objects? (Sorry for being a nuisance.)
mikeday
Not yet, it requires a bit of a rethink of the way we handle things!
rsands
+1, we have hit a stumbling block without foreignObject. Reason for foreignObject is the limited abilities of <text> and dealing with multiline.

We place divs inside of the foreignObject. Any ideas for a potential workaround? Would it involve us lifting the <divs> outside of the <svg> and positioning absolute?
mikeday
Yes, for multiline text it is simplest to use HTML outside of the SVG for now.
depth42
I wanted to add a vote for HTML foreign objects inside SVG, too.
yyang
Foreign objects are essential to mermaid diagrams. Hope this feature could be implemented in the near future.