# MathJax in edited question title gets badly mis-parsed in diff view

A recent question received an edit to its MathJax, including in the title. Viewing the diff in the edit history, the edited MathJax in the title gets very badly mis-parsed in the diff view, as shown in the screenshot below.

It seems like dollar-signs in the edited segments don’t get parsed as MathJax delimiters, so the division of what is inside/outside MathJax is wrong — the title has two MathJax blocks with text in between, like Text $x=y$ middle text $y=z$ test but the first opening \$ is missed, so the title gets parsed/displayed with just one complete MathJax block, containing the middle text.

Outside diff view, the question title displays as intended, both before and after the edit. And the diff view copes fine with MathJax edits in the question body, by marking entire MathJax blocks as edited.

• Yes, I’ve seen this many times. The diff algorithm does not know about MathJax delimiters. Feb 20 at 6:17
• @EmilJeřábek: Right, I recall seeing such issues before too — but I hadn’t ever noticed that the problem seems to be only in titles; in the body, the diff does respect MathJax. So the core work of a solution is presumably done — it just needs to be applied in the title too. Feb 20 at 8:14