Index: branches/REL1_6/phase3/includes/Parser.php |
— | — | @@ -3059,7 +3059,9 @@ |
3060 | 3060 | # Increase TOC level |
3061 | 3061 | $toclevel++; |
3062 | 3062 | $sublevelCount[$toclevel] = 0; |
3063 | | - $toc .= $sk->tocIndent(); |
| 3063 | + if( $toclevel<$wgMaxTocLevel ) { |
| 3064 | + $toc .= $sk->tocIndent(); |
| 3065 | + } |
3064 | 3066 | } |
3065 | 3067 | elseif ( $level < $prevlevel && $toclevel > 1 ) { |
3066 | 3068 | # Decrease TOC level, find level to jump to |
— | — | @@ -3081,12 +3083,15 @@ |
3082 | 3084 | } |
3083 | 3085 | } |
3084 | 3086 | } |
3085 | | - |
3086 | | - $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel ); |
| 3087 | + if( $toclevel<$wgMaxTocLevel ) { |
| 3088 | + $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel ); |
| 3089 | + } |
3087 | 3090 | } |
3088 | 3091 | else { |
3089 | 3092 | # No change in level, end TOC line |
3090 | | - $toc .= $sk->tocLineEnd(); |
| 3093 | + if( $toclevel<$wgMaxTocLevel ) { |
| 3094 | + $toc .= $sk->tocLineEnd(); |
| 3095 | + } |
3091 | 3096 | } |
3092 | 3097 | |
3093 | 3098 | $levelCount[$toclevel] = $level; |
— | — | @@ -3166,7 +3171,9 @@ |
3167 | 3172 | } |
3168 | 3173 | |
3169 | 3174 | if( $doShowToc ) { |
3170 | | - $toc .= $sk->tocUnindent( $toclevel - 1 ); |
| 3175 | + if( $toclevel<$wgMaxTocLevel ) { |
| 3176 | + $toc .= $sk->tocUnindent( $toclevel - 1 ); |
| 3177 | + } |
3171 | 3178 | $toc = $sk->tocList( $toc ); |
3172 | 3179 | } |
3173 | 3180 | |
Index: branches/REL1_6/phase3/RELEASE-NOTES |
— | — | @@ -33,6 +33,7 @@ |
34 | 34 | * Fix for concurrency problem in job queue (image description page invalidation) |
35 | 35 | * (bug 5497) regeression in HTML normalization in 1.6 (unclosed <li>,<dd>,<dt>) |
36 | 36 | * (bug 5709) Allow customisation of separator for categories |
| 37 | +* (bug 4834) Fix XHTML output when using $wgMaxTocLevel |
37 | 38 | |
38 | 39 | |
39 | 40 | == MediaWiki 1.6.3 == |