With formatversion=2 the response uses UTF-8 instead of escape sequences
with hex for encoding of non-ASCII characters (e.g. "\u00e4" for "รค").
The structural change in the response of formatversion=2 is abstracted by
this mw.Api plugin.
The test is updated.
Change-Id: I155d220dd4693bff6f8fc6c817698f2b4ac9660f
*/
parse: function ( wikitext ) {
var apiPromise = this.get( {
+ formatversion: 2,
action: 'parse',
contentmodel: 'wikitext',
text: wikitext
return apiPromise
.then( function ( data ) {
- return data.parse.text[ '*' ];
+ return data.parse.text;
} )
.promise( { abort: apiPromise.abort } );
}
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>" } }'
);
} );