API: Return parsedsummary on onlypst
[lhc/web/wiklou.git] / includes / api / ApiParse.php
index ff91b92..83e105b 100644 (file)
@@ -218,6 +218,14 @@ class ApiParse extends ApiBase {
                                        $result_array['wikitext'] = array();
                                        ApiResult::setContent( $result_array['wikitext'], $this->content->serialize( $format ) );
                                }
+                               if ( !is_null( $params['summary'] ) ) {
+                                       $result_array['parsedsummary'] = array();
+                                       ApiResult::setContent(
+                                               $result_array['parsedsummary'],
+                                               Linker::formatComment( $params['summary'], $titleObj )
+                                       );
+                               }
+
                                $result->addValue( null, $this->getModuleName(), $result_array );
 
                                return;
@@ -419,7 +427,6 @@ class ApiParse extends ApiBase {
         * @return ParserOptions
         */
        protected function makeParserOptions( WikiPage $pageObj, array $params ) {
-               wfProfileIn( __METHOD__ );
 
                $popts = $pageObj->makeParserOptions( $this->getContext() );
                $popts->enableLimitReport( !$params['disablepp'] );
@@ -427,8 +434,6 @@ class ApiParse extends ApiBase {
                $popts->setIsSectionPreview( $params['sectionpreview'] );
                $popts->setEditSection( !$params['disableeditsection'] );
 
-               wfProfileOut( __METHOD__ );
-
                return $popts;
        }