From: Conrad Irwin Date: Sat, 4 Sep 2010 00:03:45 +0000 (+0000) Subject: Bug 6204 - TOC not properly rendered when using $wgMaxTocLevel X-Git-Tag: 1.31.0-rc.0~35183 X-Git-Url: http://git.cyclocoop.org//%22javascript:ModifierStyle%28%27%22.%24id.%22%27%29/%22?a=commitdiff_plain;h=efb47b97d28a566a993715a111d0a880010a47dc;p=lhc%2Fweb%2Fwiklou.git Bug 6204 - TOC not properly rendered when using $wgMaxTocLevel Credit for mini-patch to Brandon Ooi --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cbe2d843b3..c45863d5c5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -311,6 +311,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 24981) Allow extensions to access SpecialUpload variables again * (bug 20744) Wiki forgets about an uploaded file * (bug 17913) Don't show "older edit" when no older edit available +* (bug 6204) TOC not properly rendered when using $wgMaxTocLevel === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent. diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 7bf14bf976..a98fc2980d 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3782,7 +3782,6 @@ class Parser { if ( $toclevel ) { $prevlevel = $level; - $prevtoclevel = $toclevel; } $level = $matches[1][$headlineCount]; diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 7829cbd879..02c148bd38 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -3873,6 +3873,36 @@ wgMaxTocLevel=3 !! end +!! test +TOC with wgMaxTocLevel=3 and two level four headings (bug 6204) +!! options +wgMaxTocLevel=3 +!! input +==Section 1== +===Section 1.1=== +====Section 1.1.1==== +====Section 1.1.1.1==== +==Section 2== +!! result +

Contents

+ +
+

[edit] Section 1

+

[edit] Section 1.1

+

[edit] Section 1.1.1

+

[edit] Section 1.1.1.1

+

[edit] Section 2

+ +!! end + + !! test Resolving duplicate section names !! input