Replace the new lines in plain math with spaces.
authorPlatonides <platonides@users.mediawiki.org>
Wed, 14 Apr 2010 21:22:38 +0000 (21:22 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 14 Apr 2010 21:22:38 +0000 (21:22 +0000)
This avoids interactions with the parser taking those new lines into account for the wikitext.
Fixes bug 22818 and bug 23190.

RELEASE-NOTES
includes/Math.php

index f476592..2307132 100644 (file)
@@ -109,6 +109,7 @@ in a negative namespace (which is invalid).
 * (bug 19858) Removed obsolete <big> in interface messages.
 * (bug 21456) "Bad title" error when showing non-local interwiki pages no longer
   displays incorrect tabs
+* (bug 23190) Improved math representation for text browsers.
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent
index 8cf9b8d..d42c167 100644 (file)
@@ -37,7 +37,8 @@ class MathRenderer {
 
                if( $this->mode == MW_MATH_SOURCE ) {
                        # No need to render or parse anything more!
-                       return ('$ '.htmlspecialchars( $this->tex ).' $');
+                       # New lines are replaced with spaces, which avoids confusing our parser (bugs 23190, 22818)
+                       return ('$ ' . str_replace( "\n", " ", htmlspecialchars( $this->tex ) ) . ' $');
                }
                if( $this->tex == '' ) {
                        return; # bug 8372