In the API we call $parserOutput->setTOCEnabled( false ); but for some reason we are no longer doing this for normal page views.
In onOutputPageParserOutput we call $outputPage->enableTOC( false ); which
Despite this, this request is not honoured. The table of contents is embedded in the page and wrapped in a toc element.
<toc><div id="toc" class="toc"><div id="toctitle"></div><h2>Contents</h2><div></div> <ul><li class="toclevel-1 tocsection-1"><a href="#Background"><span class="tocnumber">1</span> <span class="toctext">Background</span></a> <ul><li class="toclevel-2 tocsection-2"><a href="#Education"><span class="tocnumber">1.1</span> <span class="toctext">Education</span></a></li> </ul></li> <li class="toclevel-1 tocsection-3"><a href="#Career"><span class="tocnumber">2</span> <span class="toctext">Career</span></a> <ul><li class="toclevel-2 tocsection-4"><a href="#Theatre"><span class="tocnumber">2.1</span> <span class="toctext">Theatre</span></a></li> <li class="toclevel-2 tocsection-5"><a href="#Television"><span class="tocnumber">2.2</span> <span class="toctext">Television</span></a></li> <li class="toclevel-2 tocsection-6"><a href="#Film"><span class="tocnumber">2.3</span> <span class="toctext">Film</span></a></li> <li class="toclevel-2 tocsection-7"><a href="#Radio"><span class="tocnumber">2.4</span> <span class="toctext">Radio</span></a></li> <li class="toclevel-2 tocsection-8"><a href="#Narration"><span class="tocnumber">2.5</span> <span class="toctext">Narration</span></a></li> <li class="toclevel-2 tocsection-9"><a href="#Production_company"><span class="tocnumber">2.6</span> <span class="toctext">Production company</span></a></li> </ul></li> <li class="toclevel-1 tocsection-10"><a href="#Personal_life"><span class="tocnumber">3</span> <span class="toctext">Personal life</span></a> <ul><li class="toclevel-2 tocsection-11"><a href="#In_the_media"><span class="tocnumber">3.1</span> <span class="toctext">In the media</span></a></li> <li class="toclevel-2 tocsection-12"><a href="#Charity_and_social_action"><span class="tocnumber">3.2</span> <span class="toctext">Charity and social action</span></a></li> </ul></li> <li class="toclevel-1 tocsection-13"><a href="#Credits"><span class="tocnumber">4</span> <span class="toctext">Credits</span></a></li> <li class="toclevel-1 tocsection-14"><a href="#See_also"><span class="tocnumber">5</span> <span class="toctext">See also</span></a></li> <li class="toclevel-1 tocsection-15"><a href="#References"><span class="tocnumber">6</span> <span class="toctext">References</span></a></li> <li class="toclevel-1 tocsection-16"><a href="#External_links"><span class="tocnumber">7</span> <span class="toctext">External links</span></a></li> </ul></div> </toc>
This causes big problems for mobile
- The HTML is hidden but still there. We are also shipping a JSON of the table of contents. I hate duplication...
- The table of contents also introduces JavaScript code that has not been tested on mobile and is not used.
We should either:
- Use it to avoid the repaints with the table of contents JavaScript
OR
- Remove it from the initial load.
In the short term we should do the latter.