From: Gabriel Wicke Date: Fri, 9 Apr 2004 14:55:12 +0000 (+0000) Subject: pre area fixes, ampersand hack X-Git-Tag: 1.3.0beta1~523 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=ccac58dbb4dc5ddc09cc7747680e8f719ed709d6;p=lhc%2Fweb%2Fwiklou.git pre area fixes, ampersand hack --- 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;