Page MenuHomePhabricator

Add a template expansion paramater to action=raw
Closed, ResolvedPublic


It should be possible to show the wiki source of a page, regardless of how it
was rendered. Currently, this is not possible; layers of templates and template
parameters can make the "source" one sees far removed from the generated content.

To truly make content available for easy reuse in another wiki, it should be
possible to extract a cleaner source copy than the HTML source of the rendered
browser page. In the same sense, MW should offer "show wiki source" for the
page /it/ renders.

Version: 1.6.x
Severity: enhancement


TitleReferenceAuthorSource BranchDest Branch
Increase consistency creating user accounts for/with email addressesrepos/phabricator/phabricator!55aklapperT343647wmfUserAccountCreationwmf/stable
[builds-api]: Add build cancel endpointrepos/cloud/toolforge/builds-api!36raymond-ndibeadd_build_cancel_endpointmain
Draft: [WIP] Block user account creation for WMF folks using inconsistent metadatarepos/phabricator/phabricator!13aklapperT343647WmfOnboardingCheckwmf/stable
Customize query in GitLab

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:12 PM
bzimport set Reference to bz1436.
bzimport added a subscriber: Unknown Object (MLST).

lupin.wp wrote:

proposed patch

Here's a patch - I don't know how robust it is. Please test! To use it, specify
action=raw&expandtemplates=true in the url.

attachment t ignored as obsolete

avarab wrote:

Improved patch

Improved the patch a bit and cleaned up some code, there's still an issue with
it (and yours) it only does replacing of first-level templates, not
second-level, third leve...

attachment patch ignored as obsolete

lupin.wp wrote:

To get arbitrary-level expansion, it looks to me as if we want to use
$wgParser->replaceVariables instead of $wgParser->transformMsg. However, this
method is marked private in the comments, and I don't know how to invoke it

lupin.wp wrote:

Updated patch, expand all templates

This patch should expand all templates, including those hidden inside other


epriestley added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:21 AM