Last modified: 2009-12-30 05:22:39 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 11173 - allow limited wikicode rendering via api.php
allow limited wikicode rendering via api.php
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
Depends on:
  Show dependency treegraph
Reported: 2007-09-03 23:35 UTC by Splarka
Modified: 2009-12-30 05:22 UTC (History)
2 users (show)

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

Proposed patch (3.63 KB, patch)
2007-10-06 14:08 UTC, Victor Vasiliev

Description Splarka 2007-09-03 23:35:23 UTC
(Per IRC convo with yurik)

There is a native feature called LivePreview in the mediawiki core code (since 1.5), which allows an ajax POST request to fetch a preview (similar to action=render), but this feature request is not quite the same.

The easiest description would be by pseudoexample: /w/api.php?action=livepreview&wiki=%5B%5BFoo%5D%5D

On enwp it would return: <a href="/wiki/Foo" title="Foo">Foo</a>

On a wiki without such a page: <a href="/w/index.php?title=Foo&amp;action=edit" class="new" title="Foo">Foo</a>

Future uses include ability to link to a preview, rather than require POST data, as well as possibly speeding up popups, and giving bots the ability to check wikicode structure easier. Could also improve wikiwyg feasability.

Negative aspects do include possible performance vulnerabilities (associated with extensions) such as rapid generation of <timeline> and <math> tags (which already exist with LivePreview), but the restricted length of GET requests should limit this somewhat.

Additionally, some new format= parameters may be required for optimal usage, such as format=raw (content-type: text/plain) format=render (content-type: text/html, with wrapping xml), etc.
Comment 1 Victor Vasiliev 2007-10-05 03:11:40 UTC
Okay, the same feature will be nice for expanding templates
Comment 2 Roan Kattouw 2007-10-05 13:03:26 UTC
(In reply to comment #1)
> Okay, the same feature will be nice for expanding templates

Can't you just do this?


Comment 3 Victor Vasiliev 2007-10-06 14:08:05 UTC
Created attachment 4222 [details]
Proposed patch

Ok, here's a proposed implementation. Usage:
Comment 4 Roan Kattouw 2007-10-07 20:41:41 UTC
Will also verify and test this one tomorrow.
Comment 5 Roan Kattouw 2007-10-08 14:26:38 UTC
Added in r26501. Thanks to VasilievVV for the patch.

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