From 65ed1fd91bd42cac54793e917933ed06f6492369 Mon Sep 17 00:00:00 2001
From: Brion Vibber
", $this->mStripState );
// Only strip the very first and very last \n (which trim cannot do)
- if( substr( $text, 0, 1 ) == "\n" )
- $text = substr( $text, 1 );
+ $text = $in;
+ if( substr( $in, 0, 1 ) == "\n" )
+ $text = substr( $in, 1 );
if( substr( $text, -1 ) == "\n" )
$text = substr( $text, 0, -1 );
- $text = str_replace( "\n", "
\n", $text );
+ $text = str_replace( "\n", "$tag\n", $text );
$text = preg_replace_callback(
"/^( +)/m",
- $replacer->cb(),
+ create_function(
+ '$matches',
+ 'return str_replace(" ", " ", "$matches[0]");'
+ ),
$text );
+ $text = $this->recursiveTagParse( $text );
// Pass HTML attributes through to the output.
$attribs = Sanitizer::validateTagAttributes( $param, 'div' );
@@ -4215,7 +4218,7 @@ class Parser
$attribs['class'] = 'poem';
}
- return Xml::openElement( 'div', $attribs ) . $nl . trim( $text ) . $nl . Xml::closeElement( 'div' );
+ return XML::openElement( 'div', $attribs ) . $nl . trim( $text ) . $nl . XML::closeElement( 'div' );
}
function getImageParams( $handler ) {
diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt
index 5f5f54fc85..20876f2e8f 100644
--- a/maintenance/parserTests.txt
+++ b/maintenance/parserTests.txt
@@ -7234,7 +7234,9 @@ test
this
is
a
-test