Last modified: 2009-12-30 05:22:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T13173, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 11173 - allow limited wikicode rendering via api.php
allow limited wikicode rendering via api.php
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
http://en.wikipedia.org/w/api.php
:
Depends on:
Blocks:
  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: ---


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

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?

/w/api.php?action=livepreview&wiki={{template|param1|param2}}

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

Ok, here's a proposed implementation. Usage:
api.php?action=render&title=Test&text=dd[[ff]]{{ee}}
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.


Navigation
Links