Page MenuHomePhabricator

Text in MediaWiki:Growth-homepage-banner not wrapped in .mw-parser-output
Closed, ResolvedPublic

Description

Text you put in MediaWiki:Growth-homepage-banner is parsed like normal wikitext, and then displayed on Special:Homepage. However, the text is not wrapped in <div class="mw-parser-output"></div>, and this means that any templatestyles that are included won't apply (because all rules in templatestyles' output are prepended with .mw-parser-output).

To replicate:

Put this in [[MediaWiki:Growth-homepage-banner]]:
{{some template}}

Put this in [[Template:Some template]]:

<templatestyles src="Some template/styles.css" />
<span class="colorless-idea">Sleeping furiously</span>

Put this in [[Template:Some template/styles.css]]:

.colorless-idea {
  color: green;
}

Observe the output in [[Special:Homepage]].

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This is an issue with basically all messages. Previous discussion on the point has indicated that the workaround is intended to be adding the div and class in either the message or the template used in the message. (I don't like this work around.)

Change 858698 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@master] Add .mw-parser-output to banner module

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

Change 858698 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add .mw-parser-output to banner module

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

Etonkovidova claimed this task.
Etonkovidova subscribed.

Tested on betalabs and testwiki wmf.14 - MediaWiki:Growth-homepage-banner may display styles now:

Screen Shot 2022-12-13 at 4.18.54 PM.png (1×1 px, 290 KB)