From 4a90c54c8295c818410d2f05a334b85475ce16fb Mon Sep 17 00:00:00 2001 From: Platonides Date: Wed, 14 Apr 2010 21:22:38 +0000 Subject: [PATCH] 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. --- RELEASE-NOTES | 1 + includes/Math.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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 -- 2.20.1