Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/107601


Change subject: MathJax must not process every <strong class="error">
......................................................................

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
---
M MathRenderer.php
M modules/MathJax/extensions/wiki2jax.js
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/01/107601/1

diff --git a/MathRenderer.php b/MathRenderer.php
index 23f9b82..1f601d0 100644
--- a/MathRenderer.php
+++ b/MathRenderer.php
@@ -120,7 +120,7 @@
                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";
        }
 
        /**
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 @@
       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);
        });
   },

-- 
To view, visit https://gerrit.wikimedia.org/r/107601
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa6c3a892af463f38e6706f9407c6dcb948fe670
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to