Файловый менеджер - Редактировать - /var/www/html/mediawiki-1.43.1/tests/qunit/resources/mediawiki.api/mediawiki.api.parse.test.js
Ðазад
QUnit.module( 'mediawiki.api.edit', ( hooks ) => { let server; hooks.beforeEach( function () { server = this.sandbox.useFakeServer(); server.respondImmediately = true; } ); QUnit.test( '.parse( string )', async ( assert ) => { server.respondWith( 'POST', /api.php/, [ 200, { 'Content-Type': 'application/json' }, '{ "parse": { "text": "<p><b>Hello world</b></p>" } }' ] ); const html = await new mw.Api().parse( '\'\'\'Hello world\'\'\'' ); assert.strictEqual( html, '<p><b>Hello world</b></p>', 'Parse wikitext by string' ); } ); QUnit.test( '.parse( Object.toString )', async ( assert ) => { server.respondWith( 'POST', /api.php/, [ 200, { 'Content-Type': 'application/json' }, '{ "parse": { "text": "<p><b>Hello world</b></p>" } }' ] ); const input = { toString: function () { return '\'\'\'Hello world\'\'\''; } }; const html = await new mw.Api().parse( input ); assert.strictEqual( html, '<p><b>Hello world</b></p>', 'Parse wikitext by toString object' ); } ); QUnit.test( '.parse( mw.Title )', async ( assert ) => { server.respondWith( 'GET', /action=parse.*&page=Earth/, [ 200, { 'Content-Type': 'application/json' }, '{ "parse": { "text": "<p><b>Earth</b> is a planet.</p>" } }' ] ); const html = await new mw.Api().parse( new mw.Title( 'Earth' ) ); assert.strictEqual( html, '<p><b>Earth</b> is a planet.</p>', 'Parse page by Title object' ); } ); } );
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка