# MathJax not rendering in comments and post preview

The problem with comments seems to have resolved itself. If we used the "show x more comments" link, the MathJax would become unrendered in all comments on that page. However, this is either intermittent or has gone away.

However, when I edit an answer and immediately after I post the MathJax is unrendered:

After posting, the MathJax is rendered when I refresh. The page will appear fine to anyone who is not editing it, but this makes it very hard to edit.

System Details: MacBook Pro (OS X 10.10.4), Firefox 40.0.3 and MacPro (OS X 10.10.5), Firefox 41.0

MathJax Renderer Used: HTML-CSS

• Pertinent. If you set the renderer to HTML-CSS, the preview works (at least for me it does). – Daniel Fischer Sep 27 '15 at 16:56
• @DanielFischer: that is the renderer I was using when I edited that answer. I will add this to my question. – robjohn Sep 27 '15 at 17:16
• Does it help when you switch between HTML-CSS and Common-HTML? – Daniel Fischer Sep 27 '15 at 17:23
• I tried that, and the MathJax remained unrendered until I refreshed the page. – robjohn Sep 27 '15 at 17:23
• I've seen this on Macs running the latest Chrome and Firefox, as well. It almost never is a problem the first time I, say, add an answer to a page, but it occurs when editing a lot. – Thomas Andrews Sep 27 '15 at 20:57
• In your image, MathJax is unrendered. When this happens to me, I just wait a few seconds (around 5?) without doing anything and then it becomes rendered. – Joel Reyes Noche Sep 27 '15 at 23:16
• @JoelReyesNoche: That page had been sitting for several minutes before I took the screenshot. – robjohn Sep 28 '15 at 1:34
• Same problem. My baby PC is sick (dog broke the screen, rain killed the keyboard) and the Mac is not rendering. – André Nicolas Sep 28 '15 at 4:28
• @JoelReyesNoche It didn't render for me for several minutes. – Thomas Andrews Sep 29 '15 at 0:11
• I'm seeing Javascript error in the Chrome Javascript console: "Uncaught TypeError: this.isMathJaxNode is not a function" – Thomas Andrews Sep 29 '15 at 0:28
• Ignore my comment above. It used to be true (perhaps a few weeks ago) but I haven't tried it lately. Sorry for the noise. – Joel Reyes Noche Sep 29 '15 at 0:41
• Have you or anyone else found a good fix for this (I'm also on Mac using Firefox)? This is getting really annoying and not even reloading makes it work. – Winther Sep 30 '15 at 20:51
• @Winther: no, I have not. I have gone to composing my answers offline and copying them here. I agree that this is extremely bad. Someone must have an idea of what changed recently. – robjohn Sep 30 '15 at 21:43
• @robjohn I think I found a fix (see the answer below) we can use until it's fixed. – Winther Oct 1 '15 at 2:08
• We have pushed out 2.6.0-beta.1 which should resolve this issue. – Peter Krautzberger Oct 9 '15 at 12:43

I did some testing and found that the problem only happens when I'm on an anchored page (i.e. when the URL has an #xxxxxx behind it).

If I press this link and press 'Edit' then MathJax renders perfectly, but if I press this link and then 'Edit' then it fails and there is no rendering.

A quick fix that works for me is to simply remove the '#1458618' anchor from the URL, press enter and then Edit.

My settings: Firefox $41.0$ on OSX $10.9.5$ with HTML-CSS rendering.

• Interesting. One scenario in which simply refreshing the page doesn't help is when Comments are redacted due to their number. Expanding shows the Comments with unrendered MathJax and refreshing collapses their display. – hardmath Oct 1 '15 at 14:30
• @hardmath I just checked and the case you mention also fails for me when I have an anchored URL. The fix I mention above seems to work well also in that case. – Winther Oct 1 '15 at 15:36
• @Winther: Having read HashCheck causes error when hash is present in URL, it is not surprising that this also fixes the comment problem. – robjohn Oct 2 '15 at 8:27

This is a bug in MathJax 2.6 beta, first reported by epimorphic here. It has apparently already been fixed by the developers, but the fix has not yet been deployed here on math.SE.

As Winther correctly notes, the trigger is having an anchor identifier (like #1234567) in the page URL. Simply removing any suffix that begins with a # sign from the URL should work around the bug.

• (+1) Thanks for the link; that pretty much explains everything. So we just have to wait for a newer version of MathJax and all will be better. – robjohn Oct 2 '15 at 8:29