Index: trunk/phase3/includes/Parser.php |
— | — | @@ -3106,7 +3106,9 @@ |
3107 | 3107 | # Increase TOC level |
3108 | 3108 | $toclevel++; |
3109 | 3109 | $sublevelCount[$toclevel] = 0; |
3110 | | - $toc .= $sk->tocIndent(); |
| 3110 | + if( $toclevel<$wgMaxTocLevel ) { |
| 3111 | + $toc .= $sk->tocIndent(); |
| 3112 | + } |
3111 | 3113 | } |
3112 | 3114 | elseif ( $level < $prevlevel && $toclevel > 1 ) { |
3113 | 3115 | # Decrease TOC level, find level to jump to |
— | — | @@ -3128,12 +3130,15 @@ |
3129 | 3131 | } |
3130 | 3132 | } |
3131 | 3133 | } |
3132 | | - |
3133 | | - $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel ); |
| 3134 | + if( $toclevel<$wgMaxTocLevel ) { |
| 3135 | + $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel ); |
| 3136 | + } |
3134 | 3137 | } |
3135 | 3138 | else { |
3136 | 3139 | # No change in level, end TOC line |
3137 | | - $toc .= $sk->tocLineEnd(); |
| 3140 | + if( $toclevel<$wgMaxTocLevel ) { |
| 3141 | + $toc .= $sk->tocLineEnd(); |
| 3142 | + } |
3138 | 3143 | } |
3139 | 3144 | |
3140 | 3145 | $levelCount[$toclevel] = $level; |
— | — | @@ -3213,7 +3218,9 @@ |
3214 | 3219 | } |
3215 | 3220 | |
3216 | 3221 | if( $doShowToc ) { |
3217 | | - $toc .= $sk->tocUnindent( $toclevel - 1 ); |
| 3222 | + if( $toclevel<$wgMaxTocLevel ) { |
| 3223 | + $toc .= $sk->tocUnindent( $toclevel - 1 ); |
| 3224 | + } |
3218 | 3225 | $toc = $sk->tocList( $toc ); |
3219 | 3226 | } |
3220 | 3227 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -123,6 +123,7 @@ |
124 | 124 | * Indicate when a protected page is an interface message ("protectedinterface") |
125 | 125 | * (bug 4259) Indicate when a protected page being edited is an interface message |
126 | 126 | ("editinginterface") |
| 127 | +* (bug 4834) Fix XHTML output when using $wgMaxTocLevel |
127 | 128 | |
128 | 129 | == Compatibility == |
129 | 130 | |