$result_array['textsuppressed'] = true;
}
- if ( $params['disabletoc'] ) {
- $p_result->setTOCEnabled( false );
- }
-
if ( isset( $params['useskin'] ) ) {
$factory = MediaWikiServices::getInstance()->getSkinFactory();
$skin = $factory->makeSkin( Skin::normalizeKey( $params['useskin'] ) );
$context->setOutput( $outputPage );
if ( $skin ) {
+ // Based on OutputPage::headElement()
+ $skin->setupSkinUserCss( $outputPage );
// Based on OutputPage::output()
foreach ( $skin->getDefaultModules() as $group ) {
$outputPage->addModules( $group );
}
if ( isset( $prop['text'] ) ) {
- $result_array['text'] = $p_result->getText();
+ $result_array['text'] = $p_result->getText( [
+ 'allowTOC' => !$params['disabletoc'],
+ 'enableSectionEditLinks' => !$params['disableeditsection'],
+ ] );
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'text';
}