From: Platonides Date: Wed, 14 Apr 2010 21:22:38 +0000 (+0000) Subject: Replace the new lines in plain math with spaces. X-Git-Tag: 1.31.0-rc.0~37110 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=4a90c54c8295c818410d2f05a334b85475ce16fb;p=lhc%2Fweb%2Fwiklou.git Replace the new lines in plain math with spaces. This avoids interactions with the parser taking those new lines into account for the wikitext. Fixes bug 22818 and bug 23190. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f476592818..2307132421 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -109,6 +109,7 @@ in a negative namespace (which is invalid). * (bug 19858) Removed obsolete 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 diff --git a/includes/Math.php b/includes/Math.php index 8cf9b8d897..d42c167911 100644 --- a/includes/Math.php +++ b/includes/Math.php @@ -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