Project: moodle
Issue MDL-43856: Add a mathjax filter
A demo mathjax filter was added to the prototype.moodle.net text editor demo. This is a pretty good implementation, but there are 2 problems with it. 1/ The full mathjax library is hundreds of megabytes (fonts) - it's just too big to include the whole thing in Moodle. So - some fonts were stripped etc to keep the size of that one down - and it was still over 30MB. An alternative is to use the CDN mathjax library by default - and provide a method to download and install the full version into moodledata for people who require it (firewall/proxy etc). 2/ It does things properly (moodley) by wrapping the mathjax library a yui module and including it from the footer. This means that the loading of mathjax does not block the rest of the page displaying. The downside is that the alternative method of installing mathjax is to link to it in additionalhtmlhead. This includes mathjax earlier, so the equations on the page are rendered earlier - and some people prefer that option. Maybe there is an alternative way of including it that will load it earlier. 3/ However it is loaded/linked etc. In the forum samples I have seen, it is linked to from the head with almost a default configuration. This is a XSS risk - the tex allows some tokens which can produce e.g. javascript after rendering. MathJax has an option specifically for disabling those dangerous commands and this needs to be enabled.
Story points: 40