Spun out of T297611
When determining whether or not to show the new ToC, the same rules that govern the current ToC should be applied. If the ToC is currently hidden via magic words like __NOTOC__ or by other means, it should remain hidden in this update.
Developer notes
- If NOTOC is present in the page, SkinMustache still gets the data needed to render the table of contents. We'll need to change the core code, to provide some indication that the table of contents was disabled to support this change.
- Skin::getSectionsData should return null when NOTOC is used. Attached POC patch uses OutputPage::isTOCEnabled in core - returns false when NOTOC magic word is present. See thread in #content-transformers channel re: OutputPage::isTOCEnabled usage https://wikimedia.slack.com/archives/C024Z8K9CAU/p1642090580148800
QA steps
With the new Vector skin:
- Visit https://en.wikipedia.beta.wmflabs.org/wiki/Table_of_contents_test_page?tableofcontents=1 and confirm the table of contents is visible in the sidebar
- Visit https://en.wikipedia.beta.wmflabs.org/wiki/Table_of_contents_NOTOC_test_page?tableofcontents=1 and confirm the table of contents does not display in the sidebar or the article
QA Results - Beta
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | |
| 2 | ✅ | T298796#7671121 |
QA Results - Prod
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T298796#7706513 |
| 2 | ✅ | T298796#7671121 |








