ChangesList separates content elements from presentation
[lhc/web/wiklou.git] / includes / api / ApiParse.php
index 05b4289..148ac67 100644 (file)
@@ -323,9 +323,7 @@ class ApiParse extends ApiBase {
                                // Based on OutputPage::headElement()
                                $skin->setupSkinUserCss( $outputPage );
                                // Based on OutputPage::output()
-                               foreach ( $skin->getDefaultModules() as $group ) {
-                                       $outputPage->addModules( $group );
-                               }
+                               $outputPage->loadSkinModules( $skin );
                        }
 
                        Hooks::run( 'ApiParseMakeOutputPage', [ $this, $outputPage ] );
@@ -343,7 +341,7 @@ class ApiParse extends ApiBase {
                        $result_array['text'] = $p_result->getText( [
                                'allowTOC' => !$params['disabletoc'],
                                'enableSectionEditLinks' => !$params['disableeditsection'],
-                               'unwrap' => $params['wrapoutputclass'] === '',
+                               'wrapperDivClass' => $params['wrapoutputclass'],
                                'deduplicateStyles' => !$params['disablestylededuplication'],
                        ] );
                        $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'text';
@@ -627,7 +625,7 @@ class ApiParse extends ApiBase {
         * This mimicks the behavior of EditPage in formatting a summary
         *
         * @param Title $title of the page being parsed
-        * @param Array $params the API parameters of the request
+        * @param array $params The API parameters of the request
         * @return Content|bool
         */
        private function formatSummary( $title, $params ) {
@@ -699,7 +697,7 @@ class ApiParse extends ApiBase {
                        $hiddencats[$row->page_title] = isset( $row->pp_propname );
                }
 
-               $linkCache = LinkCache::singleton();
+               $linkCache = MediaWikiServices::getInstance()->getLinkCache();
 
                foreach ( $links as $link => $sortkey ) {
                        $entry = [];
@@ -870,7 +868,10 @@ class ApiParse extends ApiBase {
                        ],
                        'disablelimitreport' => false,
                        'disableeditsection' => false,
-                       'disabletidy' => false,
+                       'disabletidy' => [
+                               ApiBase::PARAM_DFLT => false,
+                               ApiBase::PARAM_DEPRECATED => true, // Since 1.32
+                       ],
                        'disablestylededuplication' => false,
                        'generatexml' => [
                                ApiBase::PARAM_DFLT => false,