Page MenuHomePhabricator

Templates in CSS and JS pages should not be expanded
Closed, ResolvedPublic

Description

Author: inbox2

Description:
Templates in [[MediaWiki:Common.js]] are not only expanded when viewing the
stylesheet at http://en.wikipedia.org/wiki/MedaiWiki:Common.js, but also in
the generated stylesheet code
http://en.wikipedia.org/w/index.php?title=-&action=raw&smaxage=0&gen=js. This
behaviour is inconsistent with how templates are expanded in personal
stylesheets. Not expanding templates in the generated stylesheet would allow
documentation to be placed in [[MediaWiki:Common.js]] without significantly
increasing the size of the generated stylesheet.


Version: 1.11.x
Severity: minor
URL: http://en.wikipedia.org/wiki/MediaWiki:Common.js

Details

Reference
bz8449

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:30 PM
bzimport set Reference to bz8449.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

Display in the page itself has been fixed with r23657 et al. (see bug 10432 and related). I can confirm that action=raw still expands templates for CSS/JS pages. Workaround for now: don't use templates in them. ;)

Is this fixed by ContentHandler?

This bug also applies to user JS and CSS pages; description updated.

(In reply to Nemo from comment #2)

Is this fixed by ContentHandler?

No.

  • Bug 8761 has been marked as a duplicate of this bug. ***

This is fixed, since
https://ca.wikipedia.org/w/index.php?title=MediaWiki:Common.js&action=raw&ctype=text/javascript
keeps every ocurrence of "{{referències}}" intact, therefore not increasing the size of the JS page.

It's not actually completely fixed. Things like subst still present a problem, and pages still end up in erroneous categories.

Bawolff subscribed.

http://en.wikipedia.org/w/index.php?title=-&action=raw&smaxage=0&gen=js.

We no longer use that for site javascript and RL doesn't have same behaviour. I'm closing this. For any parsing to add stuff to links tables, see T18683. For PST (subst:) see T61616: