r101783 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101782‎ | r101783 | r101784 >
Date:03:01, 3 November 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
patch by Van de Bugger from bug 32131
Modified paths:
  • /trunk/extensions/SubPageList/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SubPageList/SubPageList.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SubPageList/RELEASE-NOTES
@@ -9,6 +9,7 @@
1010
1111 * Compatibility fix with MediaWiki 1.18 and later.
1212 * Added #subpagecount parser hook.
 13+* Fixed invalid HTML for ul and ol formats (bug 32131).
1314
1415 === Version 0.4 ===
1516 2011-07-27
Index: trunk/extensions/SubPageList/SubPageList.class.php
@@ -344,16 +344,19 @@
345345 $bullet = ''; // String to render between `$start' and item
346346 // (may be rendered few times, depends on nesting level).
347347 $sep = ''; // String to render between two items.
 348+ $end = ''; // String to render once at the end of the last item.
348349 $items = array();
349350
350351 switch ( $parameters['format'] ) {
351352 case 'ol' : case 'ordered' :
352353 $start = "\n";
353354 $bullet = '#';
 355+ $end = "\n";
354356 break;
355357 case 'ul' : case 'unordered' :
356358 $start = "\n";
357359 $bullet = '*';
 360+ $end = "\n";
358361 break;
359362 case 'list' : case 'bar' :
360363 $sep = $parameters['separator'];
@@ -429,7 +432,7 @@
430433 }
431434 }
432435
433 - return implode( $sep, $items );
 436+ return count( $items ) > 0 ? implode( $sep, $items ) . $end : '';
434437 }
435438
436439 /**

Status & tagging log