2 * @class mw.Api.plugin.parse
6 $.extend( mw
.Api
.prototype, {
8 * Convenience method for 'action=parse'.
10 * @param {string} wikitext
11 * @return {jQuery.Promise}
12 * @return {Function} return.done
13 * @return {string} return.done.data Parsed HTML of `wikitext`.
15 parse: function ( wikitext
) {
16 var apiPromise
= this.get( {
19 contentmodel
: 'wikitext',
24 .then( function ( data
) {
25 return data
.parse
.text
;
27 .promise( { abort
: apiPromise
.abort
} );
33 * @mixins mw.Api.plugin.parse
36 }( mediaWiki
, jQuery
) );