Merge "mediawiki.api.parse: Use formatversion=2 for API requests"

This commit is contained in:
jenkins-bot 2016-02-05 11:44:16 +00:00 committed by Gerrit Code Review
commit 829b2e7d01
2 changed files with 3 additions and 2 deletions

View file

@ -14,6 +14,7 @@
*/
parse: function ( wikitext ) {
var apiPromise = this.get( {
formatversion: 2,
action: 'parse',
contentmodel: 'wikitext',
text: wikitext
@ -21,7 +22,7 @@
return apiPromise
.then( function ( data ) {
return data.parse.text[ '*' ];
return data.parse.text;
} )
.promise( { abort: apiPromise.abort } );
}

View file

@ -16,7 +16,7 @@
this.server.respondWith( /action=parse.*&text='''Hello\+world'''/, function ( request ) {
request.respond( 200, { 'Content-Type': 'application/json' },
'{ "parse": { "text": { "*": "<p><b>Hello world</b></p>" } } }'
'{ "parse": { "text": "<p><b>Hello world</b></p>" } }'
);
} );