As far as I understand, the MIME types state how the browser shows the output data. So, for an object of type T
, it doesn’t make sense to define two different output MIME types.
See the documentation of show
via ?show
. It depends on the type of the third parameter (the object). The behavior is not really Pluto specific. Pluto just calls show(io, mime, x)
and Julia calls the most applicable show
method.
The type of textsvg is a string, so show(io, mime, obj::String)
will be called. Instead, you could define your own type
struct MySVG
x::String
end
and your own show
method
function show(io::IO, m::MIME"image/svg+xml", obj::MySVG)
[...]
end