From: Wil Mahan Date: Sat, 25 Sep 2004 16:06:10 +0000 (+0000) Subject: Undo some of my changes to sections from templates; I think they X-Git-Tag: 1.5.0alpha1~1796 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=7bd759a96625294cad1dcefe561bf9c5c37e2eae;p=lhc%2Fweb%2Fwiklou.git Undo some of my changes to sections from templates; I think they were wrong --- diff --git a/includes/Parser.php b/includes/Parser.php index f5555920d5..c7d27a67f9 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1794,6 +1794,7 @@ class Parser } # Load from database + $itcamefromthedatabase = false; if ( !$found ) { $title = Title::newFromText( $part1, NS_TEMPLATE ); if ( !is_null( $title ) && !$title->isExternal() ) { @@ -1806,6 +1807,7 @@ class Parser if ( $articleContent !== false ) { $found = true; $text = $linestart . $articleContent; + $itcamefromthedatabase = true; } } @@ -1856,9 +1858,21 @@ class Parser $wgLinkCache->addLinkObj( $title ); } + # If the template begins with a table or block-level + # element, it should be treated as beginning a new line. + if ($linestart !== '\n' && preg_match('/^({\\||:|;|#|\*)/', $text)) { + $text = "\n" . $text; + } + } + + # Empties the template path + $this->mTemplatePath = array(); + if ( !$found ) { + return $matches[0]; + } else { # replace ==section headers== # XXX this needs to go away once we have a better parser. - if ( $this->mOutputType == OT_HTML ) { + if ( $this->mOutputType != OT_WIKI && $itcamefromthedatabase ) { if( !is_null( $title ) ) $encodedname = base64_encode($title->getPrefixedDBkey()); else @@ -1882,12 +1896,6 @@ class Parser $nsec++; } } - - # If the template begins with a table or block-level - # element, it should be treated as beginning a new line. - if ($linestart !== '\n' && preg_match('/^({\\||:|;|#|\*)/', $text)) { - $text = "\n" . $text; - } } # Empties the template path