From: Sam Reed Date: Sun, 31 Jan 2010 17:45:51 +0000 (+0000) Subject: Part 1 of bug 18427 - "add comment= parameter to action=parse, spitting out with the HTML" Done outputting "parsedsummary", though, summary may suffice? --- diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 3ad4f5a3a5..b47a7ac95d 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -136,10 +136,17 @@ class ApiParse extends ApiBase { $result_array = array(); if ( $params['redirects'] && !is_null( $redirValues ) ) $result_array['redirects'] = $redirValues; + if ( isset( $prop['text'] ) ) { $result_array['text'] = array(); $result->setContent( $result_array['text'], $p_result->getText() ); } + + if ( !is_null( $params['summary'] ) ) { + $result_array['parsedsummary'] = array(); + $result->setContent( $result_array['parsedsummary'], $wgUser->getSkin()->formatComment( $params['summary'], $titleObj ) ); + } + if ( isset( $prop['langlinks'] ) ) $result_array['langlinks'] = $this->formatLangLinks( $p_result->getLanguageLinks() ); if ( isset( $prop['categories'] ) ) @@ -242,6 +249,7 @@ class ApiParse extends ApiBase { ApiBase :: PARAM_DFLT => 'API', ), 'text' => null, + 'summary' => null, 'page' => null, 'redirects' => false, 'oldid' => null, @@ -270,6 +278,7 @@ class ApiParse extends ApiBase { public function getParamDescription() { return array ( 'text' => 'Wikitext to parse', + 'summary' => 'Summary to parse', 'redirects' => 'If the page parameter is set to a redirect, resolve it', 'title' => 'Title of page the text belongs to', 'page' => 'Parse the content of this page. Cannot be used together with text and title',