From 2b8534793fad9db18fcdb9621dc8d79ff36fdeb1 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 14 Jan 2014 21:03:45 -0500 Subject: [PATCH] MathJax must not process every Many things in MediaWiki (and various on-wiki templates, at least on enwiki) output error messages wrapped in . 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 --- MathRenderer.php | 2 +- modules/MathJax/extensions/wiki2jax.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MathRenderer.php b/MathRenderer.php index 23f9b82..1f601d0 100644 --- a/MathRenderer.php +++ b/MathRenderer.php @@ -120,7 +120,7 @@ abstract class MathRenderer { array_shift( $parameters ); $errmsg = wfMessage( $msg, $parameters )->inContentLanguage()->escaped(); $source = htmlspecialchars( str_replace( "\n", ' ', $this->tex ) ); - return "$mf($errmsg): $source\n"; + return "$mf($errmsg): $source\n"; } /** diff --git a/modules/MathJax/extensions/wiki2jax.js b/modules/MathJax/extensions/wiki2jax.js index 07734c9..963e5d7 100644 --- a/modules/MathJax/extensions/wiki2jax.js +++ b/modules/MathJax/extensions/wiki2jax.js @@ -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); }); },