2 * @class mw.Api.plugin.parse
6 $.extend( mw
.Api
.prototype, {
8 * Convinience method for 'action=parse'.
10 * @param {string} wikitext
11 * @param {Function} [ok] Success callback (deprecated)
12 * @param {Function} [err] Error callback (deprecated)
13 * @return {jQuery.Promise}
14 * @return {Function} return.done
15 * @return {string} return.done.data Parsed HTML of `wikitext`.
17 parse: function ( wikitext
, ok
, err
) {
19 // Backwards compatibility (< MW 1.20)
27 .done( function ( data
) {
28 if ( data
.parse
&& data
.parse
.text
&& data
.parse
.text
['*'] ) {
29 d
.resolve( data
.parse
.text
['*'] );
40 * @mixins mw.Api.plugin.parse
43 }( mediaWiki
, jQuery
) );