From 6f9897cffe20292630cb4958c3675373ea3dda28 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 1 May 2011 22:11:05 +0000 Subject: [PATCH] * (bug 28265) allow outputting of comments for action=expandtemplates --- RELEASE-NOTES | 1 + includes/api/ApiExpandTemplates.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 44e08402fe..e08dce9937 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -371,6 +371,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * Get a list of all subscribed hooks, and those subscribers * (bug 28225) Allow hiding of user groups in list=allusers * (bug 27185) API: Add Special:ComparePages +* (bug 28265) allow outputting of comments for action=expandtemplates === Languages updated in 1.18 === diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php index 028709eb99..dd35aaa891 100644 --- a/includes/api/ApiExpandTemplates.php +++ b/includes/api/ApiExpandTemplates.php @@ -61,6 +61,10 @@ class ApiExpandTemplates extends ApiBase { global $wgParser; $options = new ParserOptions(); + if ( $params['includecomments'] ) { + $options->setRemoveComments( false ); + } + if ( $params['generatexml'] ) { $wgParser->startExternalParse( $title_obj, $options, OT_PREPROCESS ); $dom = $wgParser->preprocessToDom( $params['text'] ); @@ -88,6 +92,7 @@ class ApiExpandTemplates extends ApiBase { ), 'text' => null, 'generatexml' => false, + 'includecomments' => false, ); } @@ -96,6 +101,7 @@ class ApiExpandTemplates extends ApiBase { 'text' => 'Wikitext to convert', 'title' => 'Title of page', 'generatexml' => 'Generate XML parse tree', + 'includecomments' => 'Whether to include HTML comments in the output', ); } -- 2.20.1