Page MenuHomePhabricator

Vector (or Vector 2022?) displays {{DISPLAYTITLE}} only when no ToC is present
Closed, ResolvedPublic

Description

Forgive me if the title isn't quite right. I'm splitting this off from T306862#8665563 where it was reported:

see https://zh.wikipedia.org/w/index.php?title=%E9%BF%AC&variant=zh-cn&oldid=76052454 , wrong page title.

If all the sections in the article are deleted, the TOC is not generated, and the title is displayed correctly. see https://zh.wikipedia.org/w/index.php?title=%F0%B0%9A%BC&variant=zh-cn&oldid=76206215

related discussion: https://zh.wikipedia.org/wiki/Wikipedia:%E4%BA%92%E5%8A%A9%E5%AE%A2%E6%A0%88/%E6%8A%80%E6%9C%AF#%E7%9B%AE%E5%BD%95%E5%BD%B1%E5%93%8D%E9%83%A8%E5%88%86%E6%9D%A1%E7%9B%AE%E6%A0%87%E9%A2%98%E6%98%BE%E7%A4%BA

I don't think this is actually related to the changes landed for T306862: Chinese Language Converter is not working in the sidebar table of the contents in Vector-2022 but this bears further investigation.

Event Timeline

A somewhat cleaner diff:

Which is presently the latest version, aka the same as:

But note that

(aka the "no conversion" output) seem to appear correctly.

The display title is generated by a template invocation {{全局僻字|𰚼|⿹气云}} whose expansion is:

This is a quite-complicated invocation of the -{T|...}- language converter rule, which sets the display title, followed by an -{H|...}- unidirectional rule, presumably intended to affect the result of the page (see https://zh.wikipedia.org/w/index.php?title=Template:%E5%85%A8%E5%B1%80%E5%83%BB%E5%AD%97&action=edit ) and that latter rule appears to be "corrupting" the display title somehow, primarily by being a <span> tag which, instead of being stripped from the display title (9f14fbd002713abcf65a5b5cddc5d52dee90a977) is instead being HTML-escaped and included as literal text.

(T26072 is a much older but perhaps related bug, although it was apparently fixed back in 2010.)

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

[mediawiki/core@master] WIP: Don't clear LanguageConverter display title when converting ToC

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

It turns out that this issue *is* related to T306862, via a side-effect of calling LanguageConverter::convertTo(). The linked patch above describes the situation in its commit message.

Change 894746 merged by jenkins-bot:

[mediawiki/core@master] Don't clear LanguageConverter display title when converting ToC

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

Shizhao claimed this task.
Shizhao subscribed.

test ok on zhwiki