Tested 2 fallback ways inside
<annotation-xml encoding="MathML-Presentation"><mtext><img ...(the math was display="block")
<annotation-xml encoding="text/html"><img ...(the math was inline)
altimg fallbacks, nor
<annotation encoding="image/png" src=...> as I figure it's unlikely any clients that don't understand MathML would honor them.
img can be honored simply by skipping all the unfamiliar tags.
I tried to use
xmlns in a way that (hopefully) would work both in HTML5 and older parsers...
EDIT: forgot one xmlns on the inline math.
Results at https://www.emailonacid.com/app/acidtest/display/result/rfoqIo77O3gXiDbcer4IPM30eMOvQUCDUGA0rP6GYGwDJ/66/shared/ (but see next test instead, has colors)
- repeat test 1 with colors: MathMLs are yellow, PNGs are green.
- added xmlns that I forgot on the inline math in mail1.html
<object>tag (putting fallback image inside it instead of inside
semantics). bug: used relative ` which can't work.
objectlink to math.xml.
objects as display: inline;
Results (TODO: not updated to mail3)
math > semantics > annotation-xml
Good news: ALL tested clients that don't render MathML show the image :-) Less good news: Most clients show both the text portions of the MathML (
n!=2πn nen 1+O 1n,
2 x) and the image. (With images off, most do show the ALT text or at least a "broken image" outline)
Clients that show neither image nor MathML:
- Lotus Notes 6.5 and 7: those don't support PNG so they show a broken image outline with ALT text. 7 was released in 2005, so I don't care.
- T-Online.de Chrome (win): with images off shows only ALT text for the
<annotation-xml encoding="text/html"><img ...image; with images on, shows neither formula!
Clients that do hide the MathML and show only images:
- BOL Chrome (Win)
- Freenet.de Chrome (win); with images off shows blank space.
- Libero Chrome (win)
- Orange.fr Chrome (win)
- SFR.fr Chrome (win)
- Terra Chrome (win), with line breaks even around the inline image; with images off shows grey and white area respectively.
Clients that render the MathML:
- Apple Mail 6
- Apple Mail 7
- iPad 2
- iPad Mini
- iPhone 5S (iOS 7, 8)
- iPhone 5S (iOS 8)
- iPhone 6 (iOS 8)
- iPhone 6+ (iOS 8)
- surprise: Outlook 2011 (Mac) (it uses WebKit)
Disappointingly, no webmail client renders the MathML - though many were tested via firefox or on mac
object > img
Worked OK in browsers (up to
object's rigid size): http://codepen.io/cben/pen/jEJpQO/
Try somehow putting MathML text externally (or pseudo-externally via data URI) so it's invisible to clients that skip math and display the image? The options I see are:
objecttag — blocked.
sharetag within MathML? It's Content MathML (and new in version 3?), so I'm concerned it may not be understood by clients that do understand MathML enough to hide the image annotation, resulting in not showing anything.
- some clever CSS that makes text invisible, but wouldn't apply to math (or would be overriden by math attributes)?