From: Gabriel Wicke Date: Sun, 4 Apr 2004 14:48:29 +0000 (+0000) Subject: fixtags hack slightly cleaned up X-Git-Tag: 1.3.0beta1~602 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=b7100af7e8c9910b9b521aa5c1c7fb8770230d86;p=lhc%2Fweb%2Fwiklou.git fixtags hack slightly cleaned up --- diff --git a/includes/Parser.php b/includes/Parser.php index b5e8c67d8c..6b16ba41ae 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -417,11 +417,6 @@ class Parser $text = $this->replaceVariables( $text ); # $text = preg_replace( "/(^|\n)-----*/", "\\1
", $text ); - $text = str_replace ( "
", "
", $text ); - $text = str_replace ( "
", "
", $text ); - $text = str_replace ( "
", "
", $text ); - $text = str_replace ( '
', '', $text ); - $text = str_replace ( '
', '', $text ); $text = $this->doHeadings( $text ); @@ -438,6 +433,13 @@ class Parser $sk =& $this->mOptions->getSkin(); $text = $sk->transformContent( $text ); + $fixtags = array( + "/
/i" => '
', + "/
/i" => '
', + "/
/i"=>'', + "/<\\/center *>/i" => '' + ); + $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text ); $text = $this->doBlockLevels( $text, $linestart ); $text .= $this->categoryMagic () ; @@ -1272,7 +1274,7 @@ class Parser $htmlpairs = array( # Tags that must be closed "b", "i", "u", "font", "big", "small", "sub", "sup", "h1", "h2", "h3", "h4", "h5", "h6", "cite", "code", "em", "s", - "strike", "strong", "tt", "var", "div", "span", + "strike", "strong", "tt", "var", "div", "center", "blockquote", "ol", "ul", "dl", "table", "caption", "pre", "ruby", "rt" , "rb" , "rp", "p" );