Tested 2 fallback ways inside semantics tag:
<annotation-xml encoding="MathML-Presentation"><mtext><img ...(the math was display="block")<annotation-xml encoding="text/html"><img ...(the math was inline)
Didn't try 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
- added
<object>tag (putting fallback image inside it instead of insidesemantics). bug: used relative ` which can't work.- fixed
objectlink to math.xml. - styled
objects as display: inline;
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)
- Thunderbird
- surprise: Outlook 2011 (Mac) (it uses WebKit)
Disappointingly, no webmail client renders the MathML - though many were tested via firefox or on mac
Worked OK in browsers (up to
object's rigid size): http://codepen.io/cben/pen/jEJpQO/Alas, completely blocked in all clients — show everywhere as blanks, with forced line break (despite
display: inline):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)?
- fixed

mail1.html: forgot xmlns on the inline math.