agrbin/svgtex — pull request #6 by Klortho (2014-01-04 08:51:59+00:00)
Title: Enhance to support MathML

Hi, first let me say, thanks for the excellent piece of software!

I've done a good bit of work on it over the last couple of days. My code isn't nearly as elegant as yours, and my changes are extensive, but I hope if you look them over, you will like them.

I kept backward compatibility in all but one respect: you now have to download and install mathjax locally. Unfortunately, I don't think there's a way around that, because the version they have deployed on the CDN is broken -- see my comments in the README.md and index.html. If you try to use the CDN version, it crashes phantomjs.

Other than that, here's the list of changes:
* Got it to work with MathML. To do that, I had to add another "input jax", which means a new

on
the page. Then, to distinguish that from the latex one, I parameterized a bunch of stuff,
* Added the ability to do conventional query-string parameters (or html form fields via POST). It is still backward compatible with the way you had it: so GET without any params is assumed to be URL encoded source string, and POST without any params is assumed to be raw, un-escaped source string. If there are any params, though, then the whole thing must be properly escaped (GET or POST) -- because otherwise there would be no way to parse out the params.
* Added the "width" param, that allows you to constrain the width.
* I added some more error handling. In particular, if MathJax craps out and doesn't even generate an