Because plugin development is currently way above my league, I just wanted to try adding KaTex via custom theme, using the autorender Katex extension. It kinda worked, but I ran into an issue with supporting a single $ sign as a math delimiter.
It seems that even though I turned off the MathJax math plugin, the text enclosed in $ $ is converted to text inside <span class=math> and the dollar signs dissappear. Weirdly, I cannot reproduce this on META. Any ideas?
Yeah the auto render stuff if very likely going to be extremely janky on Discourse. We rely on proper hooks that “decorate” chunks of HTML as they are being added to the DOM. We got to do this thing properly.
Maybe @misaka4e21 can have a look at making KaTeX optional default off in the math plugin?
One thing to consider. KaTex still lacks certain features as compared to MathJax. In Khan Academy, they actually fallback to MathJax when KaTeX fails. This would probably make sense to implement once the server-side rendering is in place, cause otherwise you’d always need to ship both Katex and mathjax, which is likely undesirable.