Page MenuHomePhabricator

Pre-save transforms (subst:, pipe trick) should run at render time as well as before save
Open, LowPublicFeature

Description


Version: unspecified
Severity: enhancement

Details

Reference
bz16714

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:25 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz16714.
bzimport added a subscriber: Unknown Object (MLST).

Currently, the pre-save transform operations (subst, pipe trick, and sigs) are only performed at edit time ("pre-save").

This leads to confusion when operations like subst: and the pipe trick are used in templates, or on dynamic operations. For consistency, it may be desireable to run these operations on regular page rendering along with template expansion.

I don't know about this: I'm pretty sure there are people out there actually using this 'feature'. AFAICT, you need to go through quite some trouble to design wikicode that only fully expands on the second PST, so any use of it is probably intentional rather than accidental. Of course, if this happens by accident too often, we do want to fix it.

conrad.irwin wrote:

safesubst: allows for "safe" substitution at either parse (to avoid breaking stuff that relies on the difference); pipe tricks are now also implemented at both stage of the parse; (as of r62029).

I think implementing signatures later in the parse would be very complicated, might lead to privacy concerns, as anyone who caused the cache to purge might end up with their signature in a page they'd never edited.

[Guessing/hoping this is directly related]

When the pipe trick is attempted to be used within <ref> or {{#ref:...}} the pipe trick fails, and having it functional would be very useful, especially where one is trying to utilise the pipe trick to deal with links like [[w:link link|]] (interwiki from within articles) or [[Namespace:...|]] (cross namespace) or [[link link (blah blah)|]].

(In reply to comment #6)

[Guessing/hoping this is directly related]

It should be bug 2700 (bug 28680 was marked as duplicate of it).

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:01 AM
Aklapper removed a subscriber: wikibugs-l-list.