Upgrading Mathjax to version 4

OK, here is the code:

https://github.com/mcmcclur/discourse/tree/mathjax-mcmcclur

Beware, though, I did not work directly from your latest commit. I started directly from Discourse main and made changes from there. Thus, I learned a fair amount from your work but the overall structure is different.

I think you could summarize the main difference as follows: Where you (naturally) use Discourse features inherited from Ember to coordinate the timings associated with things like loading and typesetting, I use MathJax features. Thus, my load-mathjax and mathjax bundles (one for svg and one for chtml) are much simpler than yours. The loading is all coordinated via the window.MathJax object in discourse-math-mathjax.

I still have the same problem that I described before, namely that this commented out loader doesn’t work; I’ve got to use this CDN version instead. I really don’t know why.

I think that your code suffers from the same problem. That’s why AsciiMath doesn’t seem to work.