Page MenuHomePhabricator
Authored By
bzimport
Nov 21 2014, 10:38 PM
Size
1 KB
Referenced Files
None
Subscribers
None
Index: includes/parser/Parser.php
===================================================================
--- includes/parser/Parser.php (revision 51213)
+++ includes/parser/Parser.php (working copy)
@@ -3477,23 +3477,19 @@
elseif ( $level < $prevlevel && $toclevel > 1 ) {
# Decrease TOC level, find level to jump to
- if ( $toclevel == 2 && $level <= $levelCount[1] ) {
- # Can only go down to level 1
- $toclevel = 1;
- } else {
- for ($i = $toclevel; $i > 0; $i--) {
- if ( $levelCount[$i] == $level ) {
- # Found last matching level
- $toclevel = $i;
- break;
- }
- elseif ( $levelCount[$i] < $level ) {
- # Found first matching level below current level
- $toclevel = $i + 1;
- break;
- }
+ for ($i = $toclevel; $i > 0; $i--) {
+ if ( $levelCount[$i] == $level ) {
+ # Found last matching level
+ $toclevel = $i;
+ break;
}
+ elseif ( $levelCount[$i] < $level ) {
+ # Found first matching level below current level
+ $toclevel = $i + 1;
+ break;
+ }
}
+ if( $i == 0 ) $toclevel = 1;
if( $toclevel<$wgMaxTocLevel ) {
if($prevtoclevel < $wgMaxTocLevel) {
# Unindent only if the previous toc level was shown :p

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5275
Default Alt Text
diff2 (1 KB)

Event Timeline