Fix #4834: correct XHTML output when using $wgMaxTocLevel