Page MenuHomePhabricator

New TOC doesn't follow scrolling between transcluded headings
Closed, InvalidPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:
The headings aren't highlighted (are blue all the time).

What should have happened instead?:
Active headings should turn black.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.: Firefox 100, Chrome 101

Event Timeline

It appears to me that the problem is caused not by the transclusion but wrapping the section headers inside some other HTML tags. In case of the page mentioned in the task description, it's due to the green box containing all the text. I've also found other page where the issue occurs and the sections are not transcluded there: https://pl.wikipedia.org/wiki/Wikiprojekt:GLAM/Projekty/Polska?useskin=vector-2022 (everything wrapped inside a <div>).

Jdlrobson subscribed.

This is working as designed.

The issue is not the transclusion but the div that wraps it

<div style="font-family: 'Helvetica Neue', 'Lucida Grande', Tahoma, Verdana, sans-serif;

We intentionally do not highlight headings in templates that do this, as we cannot guarantee the page is laid out in such a way that headings are stacked vertically. Consider a portal page for example, where headings might appear in boxes horizontal to one another e.g. https://en.wikipedia.org/wiki/Portal:Biography

I've fixed this using https://pl.wikipedia.org/w/index.php?title=Wikiprojekt%3AGLAM%2FProjekty%2FPolska&type=revision&diff=67183958&oldid=62107046 but a more long term solution would be to use https://www.mediawiki.org/wiki/Extension:TemplateStyles to apply the font changes.