From: Erik Moeller Date: Thu, 13 May 2004 17:16:50 +0000 (+0000) Subject: fix duplicate TOC problem again, which is independent of section folding X-Git-Tag: 1.3.0beta1~75 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=2b029cff3657e8e072c8ce83db78a04790b242c0;p=lhc%2Fweb%2Fwiklou.git fix duplicate TOC problem again, which is independent of section folding feature (occurred when template contained more than three headlines). --- diff --git a/includes/Parser.php b/includes/Parser.php index e488b50abd..b0b869a093 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -547,7 +547,7 @@ class Parser return $t ; } - function internalParse( $text, $linestart, $args = array() ) + function internalParse( $text, $linestart, $args = array(), $isMain=true ) { $fname = "Parser::internalParse"; wfProfileIn( $fname ); @@ -565,7 +565,7 @@ class Parser $text = $this->replaceExternalLinks( $text ); $text = $this->doTokenizedParser ( $text ); $text = $this->doTableStuff ( $text ) ; - $text = $this->formatHeadings( $text ); + $text = $this->formatHeadings( $text, $isMain ); $sk =& $this->mOptions->getSkin(); $text = $sk->transformContent( $text ); @@ -1507,7 +1507,7 @@ class Parser # Run full parser on the included text $text = $this->strip( $text, $this->mStripState ); - $text = $this->internalParse( $text, (bool)$newline, $assocArgs ); + $text = $this->internalParse( $text, (bool)$newline, $assocArgs, false ); # Add the result to the strip state for re-inclusion after # the rest of the processing @@ -1672,7 +1672,7 @@ class Parser * */ - /* private */ function formatHeadings( $text ) + /* private */ function formatHeadings( $text, $isMain=true ) { global $wgInputEncoding; @@ -1842,7 +1842,7 @@ class Parser # $full .= $sk->editSectionLink(0); } $full .= $block; - if( $doShowToc && !$i) { + if( $doShowToc && !$i && $isMain) { # Top anchor now in skin $full = $full.$toc; }