Closed Bug 593721 Opened 14 years ago Closed 11 years ago

unable to get Thunderbird to render proper MathML

Categories

(MailNews Core :: Backend, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: bogdanmatican, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Ubuntu/10.04 Chromium/5.0.375.127 Chrome/5.0.375.127 Safari/533.4
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

After 3 days of trial and error of working with proper MathML and various attempts to change Content-Type to application/XHTML+XML (as I think that should make it work), I am still unable to either set the Content-Type or, more importantly, get Thunderbird to render MathML.

Reproducible: Always




I have heard from a developer that getting TB's Gecko to render MathML is hard and not straight-forward, so I am filling this as a bug instead of an enhancement.
Component: General → Backend
Product: Thunderbird → MailNews Core
QA Contact: general → backend
Have you tried doing the same thing in Firefox as a web page to see if you can render it properly there?
(In reply to comment #1)
> Have you tried doing the same thing in Firefox as a web page to see if you can
> render it properly there?

The MathML Torture Test page works flawlessly on FF so it is not that my version of Gecko cannot render it (assuming FF and TB Gecko functionality isn't much different), the problem is, I cannot actually figure out how to get it to send an email in which to insert render-able or render-ed MathML.

More specifically, I cannot insert HTML with proper MathML and have it seen as such. I've tried different ways of changing the content-type of the piece of the e-mail containing the Math, but I couldn't get that to work either. From what I understand, Content-Type: application/xhtml+xml should suffice for proper detection.

Oh and if relevant, I have the STIX fonts too, should TB end up succeeding but not showing it properly, but that is not yet the case.
I've just been playing around with this for a bit. Thunderbird can render the web page fine, however there appear to be two issues which may or may not be related:

- The markup is either not seen as HTML or stripped when we use Insert -> HTML on a message. FTR I tried inserting:

<math mode="display" xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <msup>
      <mi>x</mi>
      <mn>2</mn>
    </msup>
    <msup>

      <mi>y</mi>

      <mn>2</mn>
    </msup>
  </mrow>
</math>

- Second, even if you do receive a message with mathml markup (I sent one to myself via telnet), then we're not displaying it. I suspect this may be again the fact we're stripping HTML markup.

cc'ing some people who may know more.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Thunderbird can display MathML in XHTML pages loaded from feeds:
https://developer.mozilla.org/@api/deki/files/4240/=mail_client_blog.png

For MathML in e-mails received, there is bug 35629 to display XHTML attachments inline. Maybe MathML-in-HTML5 could be a solution, but I don't know which version of the HTML parser is currently used in Thunderbird.

For sending mails with MathML inside, I guess a prerequisite is bug 78128.
Is there anything specific in this bug that I can help with?
(In reply to Frédéric Wang (:fredw) from comment #4)
> Maybe MathML-in-HTML5 could be a solution, but I don't
> know which version of the HTML parser is currently used in Thunderbird.
> 

I was just doing some experiments for bug 539506 and I realize that I can now send MathML with the latest version of Thunderbird!

Well the editor does not have MathML editing features yet (bug 78128), but I can already use the copy and paste to insert a mathematical formula in a mail!
Attached image Screenshot
So I guess this should be resolved WORKSFORME as Thunderbird can now render MathML in both newsfeeds or mails. You don't have an editor and need to copy & paste the MathML formulas if you want to send them by mails but that's a separate issue.
Whiteboard: [closeme 2012-12-11]
BTW, I am told that you can directly insert MathML code in Thunderbird: at the point where you want the equation, click Insert>HTML, and paste the MathML code in that dialog.
Yet another update: the MathML sent by Thunderbird in a e-mail is displayed correctly on the IPod's mail client (and I guess any Apple's product recent enough to have at least Alex Milowski's MathML implementation integrated).

However, it does not work when you read from Gmail or Outlook. The former could probably avoir filtering the MathML and let the browser render it (natively or via MathJax). The latter relies on Word rendering which uses Microsoft's OMML format. But Word has a converter from MathML to OMML, so Microsoft might in theory do something to convert from MathML (in HTML5) to OMML.
FYI, I've written a blog post summarizing the topic:

http://www.maths-informatique-jeux.com/blog/frederic/?post/2012/11/14/Writing-mathematics-in-emails

and reported a bug to Zimbra:

https://bugzilla.zimbra.com/show_bug.cgi?id=78620

Can someone please report a similar bug to Gmail (it seems that you need a gmail account to do so...) or any other popular Webmail clients?
Resolved per whiteboard and Comment 8
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Whiteboard: [closeme 2012-12-11]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: