The table of content somehow also contains all subsections we have for sitelinks but doesn't display them. The elements take some space nevertheless through margins so that the table of content has a lot of empty space. It shouldn't contain these invisible elements.
|mediawiki/extensions/MobileFrontend : master||Select headlines by class="mw-headline" instead of <span> element|
|mediawiki/extensions/MobileFrontend : master||Only add sections if an actual section heading has been found|
|mediawiki/extensions/Wikibase : master||Add class="mw-editsection" to headlines on entity pages|
|Resolved||Jdlrobson||T78430 [Epic] Getting Wikidata to render nicely on mobile web|
|Resolved||Bene||T95884 Fix table of contents on mobile Wikidata|
|Resolved||Bene||T95889 Show collapsible sections for Statements and Sitelinks|
|Resolved||thiemowmde||T110902 [Bug] Table of content too large on mobile Wikidata|
The issue here is that we have an empty <span> in the sitelink heading for counting the number of sitelinks (gets filled in js) which is found by MobileFrontend and put into the table of contents. I submitted a patch to MobileFrontend which skips empty <span> which is stuck in review so maybe we want to fix this inside of Wikibase instead.
Patches for review:
- https://gerrit.wikimedia.org/r/253621 (preferred)
- https://gerrit.wikimedia.org/r/250960 (probably obsolete if the other patch is merged)
I'm also thinking about revisiting the HTML Wikibase produces, and probably add a <span class="mw-headline">…</span> to all <h3> headlines. This would still produce the same very long TOC, but all elements will be visible then.