From ccac58dbb4dc5ddc09cc7747680e8f719ed709d6 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 9 Apr 2004 14:55:12 +0000 Subject: [PATCH] pre area fixes, ampersand hack --- includes/Parser.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index e8e4c4ecc5..4da3ddc664 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -445,6 +445,12 @@ class Parser "/<\\/center *>/i" => '' ); $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text ); + // another round, but without regex + $fixtags = array( + '& ' => '&', + '&<' => '&<', + ); + $text = str_replace( array_keys($fixtags), array_values($fixtags), $text ); $text .= $this->categoryMagic () ; @@ -1035,16 +1041,16 @@ class Parser if ( 0 == $npl ) { # No prefix--go to paragraph mode $uniq_prefix = UNIQ_PREFIX; // XXX: use a stack for nestable elements like span, table and div - $openmatch = preg_match("/(closeParagraph(); - if ( !$closematch ) { - $inBlockElem = true; - } else { + if ( $closematch ) { $inBlockElem = false; + } else { + $inBlockElem = true; } } else if ( !$inBlockElem ) { if ( " " == $t{0} ) { @@ -1054,8 +1060,8 @@ class Parser $this->mLastSection = $newSection; } else { $newSection = "p"; - if ( '' == $oLine ) { - if ( '' == $lastLine ) { + if ( '' == trim($t) ) { + if ( '' == trim($lastLine) ) { $text .= $this->closeParagraph(); $text .= "<" . $newSection . ">
"; $this->mLastSection = $newSection; -- 2.20.1