From: Gabriel Wicke Date: Mon, 22 Mar 2004 23:52:36 +0000 (+0000) Subject: xhtml tweaks, incomplete. sometimes closing p where there should be none X-Git-Tag: 1.3.0beta1~743 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=fee06ca65b0064b018b90986e0910defdad33e47;p=lhc%2Fweb%2Fwiklou.git xhtml tweaks, incomplete. sometimes closing p where there should be none --- diff --git a/includes/Parser.php b/includes/Parser.php index 4aabf70f1c..47c6598727 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -213,7 +213,7 @@ class Parser $ti = $this->mTitle->getText() ; $ti = explode ( ":" , $ti , 2 ) ; if ( $cat != $ti[0] ) return "" ; - $r = "
\n" ; + $r = "
\n" ; $articles = array() ; $parents = array () ; @@ -423,7 +423,7 @@ class Parser $text = $this->replaceVariables( $text ); # $text = preg_replace( "/(^|\n)-----*/", "\\1
", $text ); - $text = str_replace ( "
", "
", $text ); + $text = str_replace ( "
", "
", $text ); $text = $this->doHeadings( $text ); $text = $this->doBlockLevels( $text, $linestart ); @@ -687,7 +687,7 @@ class Parser $tagIsOpen = (count( $tokenStack ) != 0); break; case "----": - $txt = "\n
\n"; + $txt = "\n
\n"; break; case "'''": # This and the three next ones handle quotes @@ -891,8 +891,7 @@ class Parser /* private */ function closeParagraph() { $result = ""; - if ( 0 != strcmp( "p", $this->mLastSection ) && - 0 != strcmp( "", $this->mLastSection ) ) { + if ( 0 != strcmp( "", $this->mLastSection ) ) { $result = "mLastSection . ">"; } $this->mLastSection = ""; @@ -1026,7 +1025,7 @@ class Parser } if ( 0 == $npl ) { # No prefix--go to paragraph mode if ( preg_match( - "/(closeParagraph(); $inBlockElem = true; } @@ -1050,7 +1049,7 @@ class Parser $this->mLastSection = $newSection; } if ( $inBlockElem && - preg_match( "/(<\\/table|<\\/blockquote|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6)/i", $t ) ) { + preg_match( "/(<\\/table|<\\/blockquote|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|<\\/p)/i", $t ) ) { $inBlockElem = false; } } @@ -1273,10 +1272,10 @@ class Parser "h2", "h3", "h4", "h5", "h6", "cite", "code", "em", "s", "strike", "strong", "tt", "var", "div", "center", "blockquote", "ol", "ul", "dl", "table", "caption", "pre", - "ruby", "rt" , "rb" , "rp" + "ruby", "rt" , "rb" , "rp", "p" ); $htmlsingle = array( - "br", "p", "hr", "li", "dt", "dd" + "br", "hr", "li", "dt", "dd", "hr/" ); $htmlnest = array( # Tags that can be nested--?? "table", "tr", "td", "th", "div", "blockquote", "ol", "ul",