Merge "mediawiki.api.parse: Use formatversion=2 for API requests"
This commit is contained in:
commit
829b2e7d01
2 changed files with 3 additions and 2 deletions
|
|
@ -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 } );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>" } }'
|
||||
);
|
||||
} );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue