How to display a LateXString in pluto?

I have my type of objects Mvp (for “multivariate polynomials”) and I have overloaded latexstring for them. For example, for a certain polynomial p I have at the repl:

julia> latexstring(p)
L"$x^3+3x^2y+3xy^2+y^3$"

If in Pluto I evaluate latexstring(p) I get a nice display. So I want that whenever I evaluate an Mvp, it is displayed in Pluto via its latexstring. I thought the following would do the job:

Base.show(io::IO,::MIME"text/html",p::Mvp)=print(io,latexstring(p))

and for instance it works perfectly in an IJulia notebook. But it does not work in Pluto, it shows the unrendered string. What is the solution?

For some reason Jupyter automatically interprets $...$ inside HTML as LaTeX and renders it with MathJax:

However, in general I wouldn’t expect HTML rendering to do this, so it’s not so surprising that it doesn’t work in Pluto. I think you need to display in a format like text/latex or text/markdown that Pluto supports and which should should handle LaTeX equations, i.e.

Base.show(io::IO, ::MIME"text/latex", p::Mvp) = print(io, latexstring(p))