2 * Additional mw.Api methods to assist with API calls related to parsing wikitext.
7 $.extend( mw.Api.prototype, {
9 * Convinience method for 'action=parse'. Parses wikitext into HTML.
11 * @param wikiText {String}
12 * @param success {Function} callback to which to pass success HTML
13 * @param err {Function} callback if error (optional)
16 parse: function( wikiText, success, err ) {
21 ok = function( data ) {
22 if ( data.parse && data.parse.text && data.parse.text['*'] ) {
23 success( data.parse.text['*'] );
26 return this.get( params, { ok: ok, err: err } );
31 } )( jQuery, mediaWiki );