*/
$nl = array_key_exists( 'compact', $param ) ? '' : "\n";
- $tag = $this->insertStripItem( "<br />", $this->mStripState );
+ $replacer = new DoubleReplacer( ' ', ' ' );
+ $text = $this->recursiveTagParse( $in );
+ $text = $this->mStripState->unstripNoWiki( $text );
// Only strip the very first and very last \n (which trim cannot do)
- $text = $in;
- if( substr( $in, 0, 1 ) == "\n" )
- $text = substr( $in, 1 );
+ if( substr( $text, 0, 1 ) == "\n" )
+ $text = substr( $text, 1 );
if( substr( $text, -1 ) == "\n" )
$text = substr( $text, 0, -1 );
- $text = str_replace( "\n", "$tag\n", $text );
+ $text = str_replace( "\n", "<br />\n", $text );
$text = preg_replace_callback(
"/^( +)/m",
- create_function(
- '$matches',
- 'return str_replace(" ", " ", "$matches[0]");'
- ),
+ $replacer->cb(),
$text );
- $text = $this->recursiveTagParse( $text );
// Pass HTML attributes through to the output.
$attribs = Sanitizer::validateTagAttributes( $param, 'div' );
$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 ) {