Last modified: 2010-05-15 14:35:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 1436 - Add a template expansion paramater to action=raw
Add a template expansion paramater to action=raw
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2005-01-30 21:53 UTC by SJ
Modified: 2010-05-15 14:35 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

proposed patch (1.89 KB, patch)
2005-12-17 06:21 UTC, Lupin
Improved patch (3.01 KB, patch)
2005-12-17 14:16 UTC, Ævar Arnfjörð Bjarmason
Updated patch, expand all templates (2.95 KB, patch)
2005-12-18 23:51 UTC, Lupin

Description SJ 2005-01-30 21:53:25 UTC
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.
Comment 1 Lupin 2005-12-17 06:21:11 UTC
Created attachment 1206 [details]
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.
Comment 2 Ævar Arnfjörð Bjarmason 2005-12-17 14:16:11 UTC
Created attachment 1208 [details]
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...
Comment 3 Lupin 2005-12-17 15:09:48 UTC
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
Comment 4 Lupin 2005-12-18 23:51:32 UTC
Created attachment 1211 [details]
Updated patch, expand all templates

This patch should expand all templates, including those hidden inside other
Comment 5 Ævar Arnfjörð Bjarmason 2005-12-19 01:04:54 UTC

Note You need to log in before you can comment on or make changes to this bug.