greghendershott / markdown

Markdown parser written in Racket.
101 stars 28 forks source link

MathJax changes to support MathJax 3 #81

Closed tfeb closed 9 months ago

tfeb commented 4 years ago

This changes the way that MathJax is generated to make things work with MathJax 3 This is the second PR associated with greghendershott/frog#252

Rather than generating script tags, this now simply wraps suitable delimiters around the maths, which MathJax will then find. This is essentially because I could not work out how to make the script tags work with MathJax 3.

In fact I can't work out how the script tags ever worked: there doesn't seem to be any mention of embedding maths this way even for MathJax 2: all the focus is on using delimiters which MathJax looks for. So this would seem to make things a lot closer to how the MathJax people expect things to work, which think is a good thing.

In both MathJax 2 and 3 this makes the output look better: using the script approach seems to result in maths which, unless you apply additional styling, is blue, while this approach results in maths which is just ordinary.

This change

I'm willing to handle any problems which result from this PR.