Upgrading Mathjax to version 4

I’ve modified the discourse-math plugin so that it can parse a lot more mathematical input.

@sam When I first contributed to this plugin in 2017, I recall that you were quite firm that you wanted very strict parsing. Let me say up front that my main motivation to relax and extend the parsing was so that it would work better with AI. In particular, when you chat about mathematics with an AI bot you will often find that it responds using LaTeX and there are a lot of ways that it might choose to delimit that LaTeX input. So, while I understand your motivation for strict parsing, the changes I’ve made are rather essential for that use case.

Of course, you still might not care about that use case, so I’ve put the changes in a separate branch from my V3 pull request. If you decide you like them, I’m happy to issue another pull request.

The specific changes to the pull request are:

It accepts slash-paren delimited inline math like \(a^2+b^2=c^2\).

It accepts single line double-dollar delimited display math like
$$a^2+b^2=c^2.$$

It accepts single line slash-bracket delimited display math like 
\[a^2+b^2=c^2.\]

It accepts multi line slash-bracket delimited display math like 
\[
a^2+b^2=c^2.
\]

Of course, it still accepts the inputs of the original:

Dollar delimited inline math: $a^2+b^2=c^2$.

Multi-line, double dollar delimited display math:
$$
a^2+b^2=c^2.
$$

You can find the relevant branch here.

The code also exists as a standalone plugin.

Oh, you can also see it in action!