8

I just noticed that this diff (select "side-by-side markdown" mode if it's not already selected) is showing MathJax where it doesn't belong:

Screenshow of inappropriate MathJax in Markdown diff

(MathJax right-click menu included to show that those italics are indeed MathJax.)

Chrome's DOM inspector shows that the diff in fact does have a parent element with the class name markdown-diff tex2jax_ignore, which should cause MathJax to ignore its contents. Clearly, however, this is broken somehow. I suspect either that some JS code is calling MathJax.Hub.Typeset directly on one of the inner elements, or else that the MathJax config specifying the class names to ignore is somehow broken (which, at a glance, it doesn't seem to be).

Either way, this is clearly a bug, and should be fixed.


Ps. This seems to be a regression of When "show markdown source diffs side by side" option is used, MathJax will try to interpret $ signs in markdown source and Broken LaTeX rendering of markdown differences, both of which have been marked as fixed back in 2012.

  • 1
    I don't understand why this is being downvoted. I can reproduce this in both Edge and Chrome. In my opinion, Markdown view should only consist of Markdown, and shouldn't be parsed in any way. Is it because others can't reproduce this issue? – Sonic the Anonymous WizHog Apr 4 at 16:56
  • 2
    This appears to be a timing issue. We are adding the tex2jax_ignore class to markdown diffs in JavaScript that may or may not execute before MathJax. For me, it renders incorrectly on Safari < 10% of the time but 100% of the time in Chrome. – Brian Nickel Apr 4 at 18:21
4

This is fixed.

There was a race condition where we were marking adding the class tex2jax_ignore to elements with the class markdown-diff but sometimes only after MathJax had traversed the DOM. Since we only use markdown-diff a couple places and they all should be ignoring MathJax, I added tex2jax_ignore to the page source rather than doing it in JavaScript.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .