The Beginning of the End
Sam Ruby has been busy. He’s been lobbying for changes in the HTML5 Specification which will, ultimately, enable embedding of MathML and SVG in HTML5 documents. As a proof-of-concept, he unveiled a Javascript that enables embedding MathML and SVG in current HTML4 documents. If your browser supports MathML and/or SVG in XHTML, Sam’s script will make them work in HTML4.
Goodbye Draconian error-handling!
There are some restrictions. XML empty element syntax is not supported. So, in MathML, e.g. <none/>
would have to be changed to <none></none>
. I counted twelve lines of itex2MML code which would have to be changed to accommodate Sam’s script. That was too good to pass up.
So here’s itex2MML 1.1.6. The only change was to “fix” those 12 lines, to eliminate XML empty-element syntax. At least for Gecko-based browsers, following Sam’s instructions, you can now happily use it1 to embed MathML in good old HTML4 (or, for that matter, faux XHTML) pages, served as text/html
.
Share and enjoy!
A Well-Oiled Machine
Slightly off-topic, but I just wanted to announce that one of my pet MathML-rendering bugs got fixed. What warms my heart, though, is the chronology. I submitted the bug Sunday night. In less than an hour, Phil Ringnalda had created a test-case, and cc’d Boris Zbarsky. Zbarsky quickly diagnosed the problem and, the next morning proposed a patch. The following day, the fix was approved by Roger Sidje, and checked-in. From initial bug report to check-in of the solution? 40 hours and 6 minutes.
1 You will still need to use MathML::Entities or the corresponding MovableType plugin to process the output of itex2MML, converting named entities to NCRs. But that’s easy enough.
Re: The Beginning of the End
I’m interested to see how this one works out. There seem to be a few entrenched opinions that there is no need to allow languages like SVG to be embedded in HTML (at least without crazy-cool hacks like Sam’s). I rather disagree; it seems like it would finally eliminate the last use case for XHTML and its nightmarish parsing model.