Hi.
Brion Vibber wrote:
On Dec 8, 2004, at 11:34 AM, Robert Miner wrote:
I saw a thread from last August on the status of MathML support, and am writing to inquire if there has been any activity since.
None, so far as I know.
Thanks Brion. That's what I figured.
As co-chair of the W3C Math Interest Group, an editor of the MathML spec, and one of the authors of the MathPlayer plug-in for Internet Explorer, I am interested in doing what I can to help.
There are two things to look at.
First, is the actual conversion to MathML; currently only a couple of very simple stub bits are supported, eg nothing where it would actually be useful. :) The TeX preparser which produces HTML and MathML output is written in ocaml which unfortunately is perhaps an impediment to wide hacking on it. Currently more functions are supported for HTML output than MathML simply because the work hasn't been done.
Apart from the ocaml thing, which is a bit of a challenge, this sounds reasonably straight forward.
Second, is producing appropriate output markup. The current system will embed the MathML code directly into the XHTML output. This works in Mozilla when the wiki is configured to send an application/xml+xhtml Content-type for pages, but not when using text/html (as is default because not all browsers support this and we can't currently guarantee well-formed markup at all times).
Right. This was the thrust of the August thread as well.
Does the MathPlayer work with directly embedded code, or does it require some sort of plug-in-style usage?
It works with directly embedded MathML.
Actually for this application, the situation is pretty good. MathPlayer sniffs all incoming documents with the application/xml+xhtml MIME type and looks for a DOCTYPE declaration mentioning MathML. If it finds it, it filters the incoming document, adding a declaration to the document header to load MathPlayer and bind it to the MathML namespace. Also, since IE doesn't display XML directly, it changes the MIME type back to text/html, which "tricks" IE into displaying the document as HTML.
In practical terms, what this means is a sloppy XHTML page with embedded MathML will generally display okay in IE. Of course it still crashes in Mozilla/Netscape/Firefox.
I take it there is currently no convenient content negotiate mechanism in MediaWiki so one could serve MathML embedded in (X)HTML to IE, and HTML with PNGs to other browsers? When MathPlayer is installed in IE, it modifies the user agent string so it is easy to detect.
--Robert
------------------------------------------------------------------ Dr. Robert Miner RobertM@dessci.com W3C Math Interest Group Co-Chair 651-223-2883 Design Science, Inc. "How Science Communicates" www.dessci.com ------------------------------------------------------------------
Robert Miner wrote:
Hi.
Brion Vibber wrote:
On Dec 8, 2004, at 11:34 AM, Robert Miner wrote:
I saw a thread from last August on the status of MathML support, and am writing to inquire if there has been any activity since.
None, so far as I know.
Thanks Brion. That's what I figured.
As co-chair of the W3C Math Interest Group, an editor of the MathML spec, and one of the authors of the MathPlayer plug-in for Internet Explorer, I am interested in doing what I can to help.
There are two things to look at.
First, is the actual conversion to MathML; currently only a couple of very simple stub bits are supported, eg nothing where it would actually be useful. :) The TeX preparser which produces HTML and MathML output is written in ocaml which unfortunately is perhaps an impediment to wide hacking on it. Currently more functions are supported for HTML output than MathML simply because the work hasn't been done.
Apart from the ocaml thing, which is a bit of a challenge, this sounds reasonably straight forward.
Second, is producing appropriate output markup. The current system will embed the MathML code directly into the XHTML output. This works in Mozilla when the wiki is configured to send an application/xml+xhtml Content-type for pages, but not when using text/html (as is default because not all browsers support this and we can't currently guarantee well-formed markup at all times).
Right. This was the thrust of the August thread as well.
Does the MathPlayer work with directly embedded code, or does it require some sort of plug-in-style usage?
It works with directly embedded MathML.
Actually for this application, the situation is pretty good. MathPlayer sniffs all incoming documents with the application/xml+xhtml MIME type and looks for a DOCTYPE declaration mentioning MathML. If it finds it, it filters the incoming document, adding a declaration to the document header to load MathPlayer and bind it to the MathML namespace. Also, since IE doesn't display XML directly, it changes the MIME type back to text/html, which "tricks" IE into displaying the document as HTML.
In practical terms, what this means is a sloppy XHTML page with embedded MathML will generally display okay in IE. Of course it still crashes in Mozilla/Netscape/Firefox.
I take it there is currently no convenient content negotiate mechanism in MediaWiki so one could serve MathML embedded in (X)HTML to IE, and HTML with PNGs to other browsers? When MathPlayer is installed in IE, it modifies the user agent string so it is easy to detect.
--Robert
Dr. Robert Miner RobertM@dessci.com W3C Math Interest Group Co-Chair 651-223-2883 Design Science, Inc. "How Science Communicates" www.dessci.com
Programming for IE only should be no issue. When MathML only works with IE it is broken beyond repair. Thanks, GerardM
On Thu, 09 Dec 2004 13:56:49 -0500, Delirium delirium@hackish.org wrote:
Gerard Meijssen wrote:
Programming for IE only should be no issue. When MathML only works with IE it is broken beyond repair.
I'd say it's Firefox that's broken in this case, due to its lack of support for W3C standards.
Well, in that case *all* browsers are broken, since AFAIK none of them *natively* support MathML. That someone's written an extension for IE which, as I understand it, *exploits bugs* to allow MathML to be embedded in any-old-HTML content is not exactly "support for W3C standards". Actual support would imply the browser processing the MathML as part of a multi-namespaced (or however it's supposed to work) XML document, not some extension ripping it out and fiddling with the rest of the content to trick the browser.
On Dec 9, 2004, at 10:56 AM, Delirium wrote:
Gerard Meijssen wrote:
Programming for IE only should be no issue. When MathML only works with IE it is broken beyond repair.
I'd say it's Firefox that's broken in this case, due to its lack of support for W3C standards.
Firefox correctly rejects XML that is not well-formed -- to render such pages would be in flagrant violation of the standard.
Unfortunately the wiki can't currently guarantee that output for all inputs will be well-formed, so it's not safe for us to send the application/xhtml+xml content type.
(Hypothetically we could do an XML parsing pass on output and then send text/html if it's not well-formed. But that's... uuuugly and probably very slow and will get us shot. :)
-- brion vibber (brion @ pobox.com)
Delirium wrote:
Gerard Meijssen wrote:
Programming for IE only should be no issue. When MathML only works with IE it is broken beyond repair.
I'd say it's Firefox that's broken in this case, due to its lack of support for W3C standards.
-Mark
I had a read on the Mozilla website, they do support MathML so again, when MathML only works for IE it is broken beyond repair. There is one requirement; you need the appropriate fonts loaded on your system. Thanks, GerardM
On Dec 9, 2004, at 8:17 AM, Robert Miner wrote:
In practical terms, what this means is a sloppy XHTML page with embedded MathML will generally display okay in IE. Of course it still crashes in Mozilla/Netscape/Firefox.
Fun. :P :)
I take it there is currently no convenient content negotiate mechanism in MediaWiki so one could serve MathML embedded in (X)HTML to IE, and HTML with PNGs to other browsers? When MathPlayer is installed in IE, it modifies the user agent string so it is easy to detect.
Not currently. Since the math rendering option affects the wiki -> HTML conversion it could play hell with our caching if done naively.
-- brion vibber (brion @ pobox.com)
wikitech-l@lists.wikimedia.org