/**
* @class mw.Api.plugin.parse
*/
-( function ( mw, $ ) {
+( function () {
$.extend( mw.Api.prototype, {
/**
if ( mw.Title && content instanceof mw.Title ) {
// Parse existing page
config.page = content.getPrefixedDb();
+ apiPromise = this.get( config );
} else {
// Parse wikitext from input
config.text = String( content );
+ apiPromise = this.post( config );
}
- apiPromise = this.get( config );
-
return apiPromise
.then( function ( data ) {
return data.parse.text;
* @mixins mw.Api.plugin.parse
*/
-}( mediaWiki, jQuery ) );
+}() );