Page MenuHomePhabricator

User CSS/JS should not be parsed for link tables without rendering
Open, LowPublic

Description

Author: mike.lifeguard+bugs

Description:
Templates in user JS/CSS files are listed as being transcluded, though they actually aren't. Therefore, they shouldn't be listed. See http://commons.wikimedia.org/wiki/User:Alpta/monobook.js for example - Template:Flickrreview is listed as being transcluded in this page, though it isn't really.

See also:

Details

Reference
bz16683

Event Timeline

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

random832 wrote:

Also, categories.

mike.lifeguard+bugs wrote:

Thanks to Splarka for the suggested & more accurate summary.

random832 wrote:

Actually, on second thought, some people do intentionally use links for tracking with whatlinkshere. So maybe just suppress transclusion?

mike.lifeguard+bugs wrote:

(In reply to comment #3)

Actually, on second thought, some people do intentionally use links for
tracking with whatlinkshere. So maybe just suppress transclusion?

If it's not a link, its not a link.

Though, do note that some of us like to use an extra include or whatnot, to actually enable &templates=expand inside of the action=raw for their css/js pages.

Templates are a real interesting method of making it possible to cleanly separate your code, yet not require inclusion of a large number of files into the page slowing down loading.

herd wrote:

That sh(In reply to comment #5)

Though, do note that some of us like to use an extra include or whatnot, to
actually enable &templates=expand inside of the action=raw for their css/js
pages.

This shouldn't actually affect whether &templates=expand work or not (and if it does, it shouldn't). This is just a bug indicating which parse method should be used for the purposes of registering page information, such as links/templates/categories/images.

This in a way is similar to the debate over bug 14404 -- a proposed solution is that int: should parse the page in content language for the purposes of links, and in user language for viewing.(In reply to comment #3)

Actually, on second thought, some people do intentionally use links for
tracking with whatlinkshere. So maybe just suppress transclusion?

I find the new search quite good at this actually (but that is a bit of a Wikimedia-centric view).

As far as I can see this behavior was changed with the introduction of ContentHandler. JS/CSS pages are no longer wikitext, so they are no longer parsed at all.

Reopening, this doesn't actually seem fixed. I'm not sure where I got that impression.

E.g. this page[1] is listed in this category[2].

[1] https://pl.wikipedia.org/wiki/Wikipedysta:Blackfish/en2pl.js
[2] https://pl.wikipedia.org/wiki/Kategoria:Miasta_w_hrabstwie_$1

That doesn't make this behavior not wrong by itself.

While I see that this bug has actually become a feature and some people e.g use the backlinks to track script usage, this is highly unreliable and would be better accomplished by scanning the database dump.

I vaguely remember some discussion about this behavior when ContentHandler was being introduced, but I have no idea where it took place and what was the outcome.

He7d3r updated the task description. (Show Details)
Krinkle renamed this task from User CSS/JS should be parsed as it is rendered, with all wikicode ignored (treated as source/pre) to User CSS/JS should not parsed for link tables.Nov 2 2016, 7:15 PM
Krinkle renamed this task from User CSS/JS should not parsed for link tables to User CSS/JS should not be parsed for link tables without rendering.
Krinkle removed a subscriber: wikibugs-l-list.

(Duplicating comment at T10761 which seems to be a duplicate task.)

I got used to editing some JS and seeing in the bottom something like:

Templates used on this page:

Шаблон:$1 (edit)
Шаблон:$2 (edit)
Шаблон:·/•/* (edit)

It also clutters "what links here" and other special pages.

I understand after reading T34858 that somebody sees parsing JS/CSS for database tables as feature (e.g., helping in categorization and substing), but what use do bogus template transclusions have? What are they helpful for?