Last modified: 2014-09-23 23:41:42 UTC
This patch renders math equations in the diff pages colouring it the same way the diffengine colours text diffs. See the example at the above URL.
Created attachment 3210 [details] Coloured math diffs patch
This appears to also make the math background transparent. That has been rejected before, because it's possible that the user will be using a very dark background color, making the text (which is always black) hard or impossible to read. Try to keep unrelated changes out of patches, so that they're easier to review. Other than that, it looks to be quite a nice change. I'm slightly concerned with usability, though, because presumably most non-image clients won't render the \color bit as distinctly as they'll probably render the <ins> or <del>. Perhaps set the alt text on the images to the empty string, and put the text of the math tag immediately below it. I.e., instead of <img src="..." alt="x{\color{red}^2}" /> have <img src="..." alt="" /> <math>x<ins class="diffchange">^2</ins></math>. Of course, that means that visual clients will also see the superfluous diff of the actual math text, but perhaps that's a feature: it will quickly show them what bits they need to change in the wikitext to partially reverse the change, say.
I thought that it would look better. Maybe we could solve it by setting the math foreground color to match the CSS settings. But I have no idea of how to fetch this info using php code. We can also get rid of this problem if we let the user select this feature as a user preference.
Please confine any background-transparency remarks to bug 6954.
As Rob reminds me at bug 8981 comment 1, as written this will have no effect on WMF sites, because we use wikidiff2 for diffs. http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/wikidiff2/
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
I'm adding the "reviewed" keyword here because Aryeh has reviewed the patch. Thanks for the patch, Felipe; do you have interest and time to rework it?
CC'ing the Math maintainers in case they can provide input how complicated / feasible this could be.