MathJax must not process every <strong class="error">

Many things in MediaWiki (and various on-wiki templates, at least on
enwiki) output error messages wrapped in <strong class="error">. MathJax
parsing all of these (added in I1199cb34) is completely broken.

What appears to have been intended is that MathJax would parse the
errors output by MathRenderer.php. So let's add a "texerror" class to
those and have MathJax look for that class instead.

Bug: 55675
Change-Id: Iaa6c3a892af463f38e6706f9407c6dcb948fe670
This commit is contained in:
Brad Jorsch 2014-01-14 21:03:45 -05:00
parent cf8cbfd44b
commit 2b8534793f
2 changed files with 2 additions and 2 deletions

View file

@ -120,7 +120,7 @@ abstract class MathRenderer {
array_shift( $parameters );
$errmsg = wfMessage( $msg, $parameters )->inContentLanguage()->escaped();
$source = htmlspecialchars( str_replace( "\n", ' ', $this->tex ) );
return "<strong class='error'>$mf($errmsg): $source</strong>\n";
return "<strong class='error texerror'>$mf($errmsg): $source</strong>\n";
}
/**

View file

@ -20,7 +20,7 @@ MathJax.Extension.wiki2jax = {
this.configured = true;
}
var that = this;
$('span.tex, img.tex, strong.error', element || document).each(function(i, span) {
$('span.tex, img.tex, strong.texerror', element || document).each(function(i, span) {
that.ConvertMath(span);
});
},