Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -7234,9 +7234,7 @@ |
7235 | 7235 | this<br /> |
7236 | 7236 | is<br /> |
7237 | 7237 | a<br /> |
7238 | | -test<br /> |
7239 | | - |
7240 | | -</p> |
| 7238 | +test</p> |
7241 | 7239 | </div> |
7242 | 7240 | |
7243 | 7241 | !!end |
— | — | @@ -7256,9 +7254,7 @@ |
7257 | 7255 | this<br /> |
7258 | 7256 | '''is'''<br /> |
7259 | 7257 | a<br /> |
7260 | | -test<br /> |
7261 | | - |
7262 | | -</p> |
| 7258 | +test</p> |
7263 | 7259 | </div> |
7264 | 7260 | |
7265 | 7261 | !! end |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -4190,23 +4190,20 @@ |
4191 | 4191 | */ |
4192 | 4192 | $nl = array_key_exists( 'compact', $param ) ? '' : "\n"; |
4193 | 4193 | |
4194 | | - $tag = $this->insertStripItem( "<br />", $this->mStripState ); |
| 4194 | + $replacer = new DoubleReplacer( ' ', ' ' ); |
| 4195 | + $text = $this->recursiveTagParse( $in ); |
| 4196 | + $text = $this->mStripState->unstripNoWiki( $text ); |
4195 | 4197 | // Only strip the very first and very last \n (which trim cannot do) |
4196 | | - $text = $in; |
4197 | | - if( substr( $in, 0, 1 ) == "\n" ) |
4198 | | - $text = substr( $in, 1 ); |
| 4198 | + if( substr( $text, 0, 1 ) == "\n" ) |
| 4199 | + $text = substr( $text, 1 ); |
4199 | 4200 | if( substr( $text, -1 ) == "\n" ) |
4200 | 4201 | $text = substr( $text, 0, -1 ); |
4201 | 4202 | |
4202 | | - $text = str_replace( "\n", "$tag\n", $text ); |
| 4203 | + $text = str_replace( "\n", "<br />\n", $text ); |
4203 | 4204 | $text = preg_replace_callback( |
4204 | 4205 | "/^( +)/m", |
4205 | | - create_function( |
4206 | | - '$matches', |
4207 | | - 'return str_replace(" ", " ", "$matches[0]");' |
4208 | | - ), |
| 4206 | + $replacer->cb(), |
4209 | 4207 | $text ); |
4210 | | - $text = $this->recursiveTagParse( $text ); |
4211 | 4208 | |
4212 | 4209 | // Pass HTML attributes through to the output. |
4213 | 4210 | $attribs = Sanitizer::validateTagAttributes( $param, 'div' ); |
— | — | @@ -4218,7 +4215,7 @@ |
4219 | 4216 | $attribs['class'] = 'poem'; |
4220 | 4217 | } |
4221 | 4218 | |
4222 | | - return XML::openElement( 'div', $attribs ) . $nl . trim( $text ) . $nl . XML::closeElement( 'div' ); |
| 4219 | + return Xml::openElement( 'div', $attribs ) . $nl . trim( $text ) . $nl . Xml::closeElement( 'div' ); |
4223 | 4220 | } |
4224 | 4221 | |
4225 | 4222 | function getImageParams( $handler ) { |