4
$\begingroup$

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.

image of diff view showing garbled title

$\endgroup$
2
  • 1
    $\begingroup$ Yes, I’ve seen this many times. The diff algorithm does not know about MathJax delimiters. $\endgroup$ Commented Feb 20, 2023 at 6:17
  • $\begingroup$ @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. $\endgroup$ Commented Feb 20, 2023 at 8:14

0

You must log in to answer this question.

Browse other questions tagged .