Page MenuHomePhabricator

The table of contents always shows up in the article body on preview even if skin disables it
Closed, ResolvedPublic

Description

When using a skin that disables table of contents by adding "toc": false to skin.json like so:

`
diff --git a/skin.json b/skin.json
index 515b8c2..f4e9a6a 100644
--- a/skin.json
+++ b/skin.json
@@ -25,6 +25,7 @@
                                                "skins.vector.es6",
                                                "skins.vector.js"
                                        ],
+                                       "toc": false,
                                        "templateDirectory": "includes/templates",
                                        "responsive": true,
                                        "styles": [

and visit http://localhost:8888/w/index.php?title=Table_of_contents_test&action=edit with JavaScript disabled and click "show preview"

I see the table of contents in the preview:

Screen Shot 2021-12-02 at 2.48.19 PM.png (1×1 px, 705 KB)

Expected: the preview should not show table of contents.

Event Timeline

Change 743267 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Table of contents should not show in previews for skins that have requested not to show it

https://gerrit.wikimedia.org/r/743267

Jdlrobson renamed this task from The table of contents always shows up in the article body on preview to The table of contents always shows up in the article body on preview even if skin disables it.Dec 3 2021, 12:43 AM

Change 743267 merged by jenkins-bot:

[mediawiki/core@master] Table of contents should not show in previews for skins that have requested not to show it

https://gerrit.wikimedia.org/r/743267