Index: includes/GlobalFunctions.php =================================================================== --- includes/GlobalFunctions.php (revision 24695) +++ includes/GlobalFunctions.php (working copy) @@ -592,7 +592,7 @@ } elseif ( in_array('parseinline', $options) ) { $string = $wgOut->parse( $string, true, true ); $m = array(); - if( preg_match( '/^
(.*)\n?<\/p>$/sU', $string, $m ) ) { + if( preg_match( '/^
(.*)\n?<\/p>\n?$/sU', $string, $m ) ) { $string = $m[1]; } } elseif ( in_array('parsemag', $options) ) { Index: includes/OutputPage.php =================================================================== --- includes/OutputPage.php (revision 24695) +++ includes/OutputPage.php (working copy) @@ -347,10 +347,12 @@ wfIncrStats('pcache_not_possible'); $popts = $this->parserOptions(); - $popts->setTidy($tidy); + $oldTidy = $popts->setTidy($tidy); $parserOutput = $wgParser->parse( $text, $title, $popts, $linestart, true, $this->mRevisionId ); + + $popts->setTidy( $oldTidy ); $this->addParserOutput( $parserOutput );