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( {
18 contentmodel: 'wikitext',
23 .then( function ( data ) {
24 return data.parse.text['*'];
26 .promise( { abort: apiPromise.abort } );
32 * @mixins mw.Api.plugin.parse
35 }( mediaWiki, jQuery ) );