From cd148a2b8fe75c491428a80a8dca95e1e2b558c7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 24 Mar 2008 23:33:31 +0000 Subject: [PATCH] * (bug 12077) Fix HTML nesting for TOC Patch by WTucker at https://bugzilla.wikimedia.org/show_bug.cgi?id=12077#c5 Plus parser test case --- RELEASE-NOTES | 1 + includes/Parser.php | 1 + maintenance/parserTests.txt | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 45b3bcae3d..cb671fcd3b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -128,6 +128,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11874) Inline CSS with !important no longer borken * (bug 1600) Strip extra == section markup == in new-comment field * (bug 11325) Wrapped page titles in MonoBook skin spaced more nicely +* (bug 12077) Fix HTML nesting for TOC === API changes in 1.13 === diff --git a/includes/Parser.php b/includes/Parser.php index 86e90cee24..64ebdc89b1 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3437,6 +3437,7 @@ class Parser if($prevtoclevel < $wgMaxTocLevel) { # Unindent only if the previous toc level was shown :p $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel ); + $prevtoclevel = $toclevel; } else { $toc .= $sk->tocLineEnd(); } diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index a8ca7d913a..109407e2a6 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -3605,6 +3605,29 @@ Link inside a section heading !! end +!! test +TOC regression (bug 12077) +!! input +__TOC__ +== title 1 == +=== title 1.1 === +== title 2 == +!! result +

Contents

+ +
+

[edit] title 1

+

[edit] title 1.1

+

[edit] title 2

+ +!! end !! test BUG 1219 URL next to image (good) -- 2.20.1