* (bug 28265) allow outputting of comments for action=expandtemplates
authorSam Reed <reedy@users.mediawiki.org>
Sun, 1 May 2011 22:11:05 +0000 (22:11 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 1 May 2011 22:11:05 +0000 (22:11 +0000)
RELEASE-NOTES
includes/api/ApiExpandTemplates.php

index 44e0840..e08dce9 100644 (file)
@@ -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 ===
 
index 028709e..dd35aaa 100644 (file)
@@ -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',
                );
        }