Page MenuHomePhabricator

__TOC__ not showing up in Parsoid on Norwegian Bokmål village pump pages
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
The TOC, which is added with __TOC__ in one of the templates is not visible when Parsoid is used (Mal:Trådinfo), inside a div element and before a table element.

What should have happened instead?:
The TOC should be shown. It actually appears in the DOM, but inside a span class="mw-empty-elt"

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Related Objects

Mentioned In
T423241: Thumbtime for TimedMedia no longer working
T423701: Serialize ContentHolder (or at least its fragments) in ParserOutput
T373384: Parsoid doesn't properly handle double-underscore magic words
T425731: CTT tasks week of 2026-05-01
T425056: 1.46.0-wmf.26 broke itwiki's Template:Divisa calcio
T425008: WrapSectionState crash: Wikimedia\Assert\InvariantException: Invariant failed: Expected only language variants to be missing about ids.
T420336: mw-parsoid improvements
T424446: Space added for no reason
T319058: ParserTests defaults to wgAllowExternalImages=true
T424773: __NOCONTENTCONVERT__ is not honored in Parsoid
T368724: Rendering diff on broken link with template (visual diff testing)
T425245: hlists not formatted properly on enwiki mobile
Mentioned Here
T319058: ParserTests defaults to wgAllowExternalImages=true
T368724: Rendering diff on broken link with template (visual diff testing)
T373384: Parsoid doesn't properly handle double-underscore magic words
T420336: mw-parsoid improvements
T423241: Thumbtime for TimedMedia no longer working
T423701: Serialize ContentHolder (or at least its fragments) in ParserOutput
T424446: Space added for no reason
T424773: __NOCONTENTCONVERT__ is not honored in Parsoid
T425008: WrapSectionState crash: Wikimedia\Assert\InvariantException: Invariant failed: Expected only language variants to be missing about ids.
T425056: 1.46.0-wmf.26 broke itwiki's Template:Divisa calcio
T425731: CTT tasks week of 2026-05-01
T378906: Categories as link tags cause navboxes to have a rendering difference

Event Timeline

(Note: this requires a non-Vector2022 skin to reproduce)

The problem is that we consider the TOC-generated meta as a rendering-transparent node for the purpose of T378906, and they are not necessarily - since they get replaced by a block of HTML in non-Vector2022 cases.

I have a couple of drafts as user pages where I use two different TOC templates:

The issue affects several no-Wiki pages, all of which had a right aligned TOC, and it happened just recently (last 24 hours or so). Some examples:

However, https://no.wikipedia.org/wiki/Wikipedia:Nybegynnerforum where the TOC is aligned to the left is not affected.

The same issue affects de.Wikipedia via the template https://de.wikipedia.org/wiki/Vorlage:TOCright (2561 transclusions). Example: https://de.wikipedia.org/wiki/B%C3%BCrgermeister?useskin=vector

The discussion under https://de.wikipedia.org/wiki/Wikipedia:Fragen_zur_Wikipedia#Parsoid_und_Vorlage:TOCright lists some unaffected articles with the template. However, I found that after a purge those articles are affected as well.

Using the Firefox Inspector I found that the TOC in those articles is actually present but wrapped within

<span class="mw-empty-elt">

Change #1281735 had a related patch set uploaded (by SomeRandomDeveloper; author: SomeRandomDeveloper):

[mediawiki/services/parsoid@master] Don't stash TOC markers in mw-empty-elt elements

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

Change #1281735 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Don't stash TOC markers in mw-empty-elt elements

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

I cannot estimate the change by @SomeRandomDeveloper and my reaction may be hyperfluous by now, but:

As Wikidata:Q5626794 shows template TOCright (the name slightly varies) is widely used (well, this does not show, how often this template is actually transcluded on a given project), so there should be some solution as long as projects do decide not to delete it, because in Minerva (mobile) and Vector-2022 skins, the defaults for most of the readers nowadays, it is without any benefit. And as @valcio pointed out the same could be said about template TOCleft, though this is used rarer, see Wikidata:Q8383694.

For what it's worth, we do expect that the patch that got merged on Saturday (https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/1281735) will fix all these TOC issues. It should be on next week's train.

Change #1284813 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.24.0-a2

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

Change #1284813 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.24.0-a2

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

Change #1284832 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@wmf/1.47.0-wmf.1] Bump wikimedia/parsoid to 0.24.0-a2

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

Change #1284832 merged by jenkins-bot:

[mediawiki/vendor@wmf/1.47.0-wmf.1] Bump wikimedia/parsoid to 0.24.0-a2

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

Mentioned in SAL (#wikimedia-operations) [2026-05-07T21:15:34Z] <cscott@deploy1003> Started scap sync-world: Backport for [[gerrit:1284828|Upgrading webonyx/graphql-php (v15.31.5 => v15.32.3)]], [[gerrit:1284834|composer.json: Update webonyx/graphql-php to ^15.32.3]], [[gerrit:1284832|Bump wikimedia/parsoid to 0.24.0-a2 (T319058 T368724 T373384 T420336 T423241 T423701 T424446 T424773 T425008 T425056 T425107 T425731)]], [[gerrit:1284837|Bump wikimedia/parsoid to 0.24.0-a2 (T425731)]

Mentioned in SAL (#wikimedia-operations) [2026-05-07T21:17:28Z] <cscott@deploy1003> cscott: Backport for [[gerrit:1284828|Upgrading webonyx/graphql-php (v15.31.5 => v15.32.3)]], [[gerrit:1284834|composer.json: Update webonyx/graphql-php to ^15.32.3]], [[gerrit:1284832|Bump wikimedia/parsoid to 0.24.0-a2 (T319058 T368724 T373384 T420336 T423241 T423701 T424446 T424773 T425008 T425056 T425107 T425731)]], [[gerrit:1284837|Bump wikimedia/parsoid to 0.24.0-a2 (T425731)]] synced to the t

Mentioned in SAL (#wikimedia-operations) [2026-05-07T21:27:35Z] <cscott@deploy1003> Finished scap sync-world: Backport for [[gerrit:1284828|Upgrading webonyx/graphql-php (v15.31.5 => v15.32.3)]], [[gerrit:1284834|composer.json: Update webonyx/graphql-php to ^15.32.3]], [[gerrit:1284832|Bump wikimedia/parsoid to 0.24.0-a2 (T319058 T368724 T373384 T420336 T423241 T423701 T424446 T424773 T425008 T425056 T425107 T425731)]], [[gerrit:1284837|Bump wikimedia/parsoid to 0.24.0-a2 (T425731)

With the deploy from about 30 mins back, this should now be fixed. Please verify.

With the deploy from about 30 mins back, this should now be fixed. Please verify.

I can confirm this @ no-Wiki.

Works for TOCleft and TOCright (which I wrote about above) at dewiki. Sometimes a purge is necessary.