r32387 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32386‎ | r32387 | r32388 >
Date:23:33, 24 March 2008
Author:brion
Status:old
Tags:
Comment:
* (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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -3605,7 +3605,30 @@
36063606
36073607 !! end
36083608
 3609+!! test
 3610+TOC regression (bug 12077)
 3611+!! input
 3612+__TOC__
 3613+== title 1 ==
 3614+=== title 1.1 ===
 3615+== title 2 ==
 3616+!! result
 3617+<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
 3618+<ul>
 3619+<li class="toclevel-1"><a href="#title_1"><span class="tocnumber">1</span> <span class="toctext">title 1</span></a>
 3620+<ul>
 3621+<li class="toclevel-2"><a href="#title_1.1"><span class="tocnumber">1.1</span> <span class="toctext">title 1.1</span></a></li>
 3622+</ul>
 3623+</li>
 3624+<li class="toclevel-1"><a href="#title_2"><span class="tocnumber">2</span> <span class="toctext">title 2</span></a></li>
 3625+</ul>
 3626+</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
 3627+<a name="title_1"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline"> title 1 </span></h2>
 3628+<a name="title_1.1"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline"> title 1.1 </span></h3>
 3629+<a name="title_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline"> title 2 </span></h2>
36093630
 3631+!! end
 3632+
36103633 !! test
36113634 BUG 1219 URL next to image (good)
36123635 !! input
Index: trunk/phase3/includes/Parser.php
@@ -3437,6 +3437,7 @@
34383438 if($prevtoclevel < $wgMaxTocLevel) {
34393439 # Unindent only if the previous toc level was shown :p
34403440 $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel );
 3441+ $prevtoclevel = $toclevel;
34413442 } else {
34423443 $toc .= $sk->tocLineEnd();
34433444 }
Index: trunk/phase3/RELEASE-NOTES
@@ -128,6 +128,7 @@
129129 * (bug 11874) Inline CSS with !important no longer borken
130130 * (bug 1600) Strip extra == section markup == in new-comment field
131131 * (bug 11325) Wrapped page titles in MonoBook skin spaced more nicely
 132+* (bug 12077) Fix HTML nesting for TOC
132133
133134
134135 === API changes in 1.13 ===

Follow-up revisions

RevisionCommit summaryAuthorDate
r32998* (bug 12077) Fix HTML nesting for TOC...brion23:48, 8 April 2008
r38208Revert r38196, r38204 -- "(bugs 6089, 13079) Show edit section links for tran...brion23:56, 29 July 2008
r53308Fix parser tests for r52213....catrope11:29, 15 July 2009

Status & tagging log