aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/parse.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/parse.php')
-rw-r--r--maintenance/parse.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/maintenance/parse.php b/maintenance/parse.php
index 17a8d2ebf4f0..6279a348ac7d 100644
--- a/maintenance/parse.php
+++ b/maintenance/parse.php
@@ -68,6 +68,7 @@ class CLIParser extends Maintenance {
false,
true
);
+ $this->addOption( 'tidy', 'Tidy the output' );
$this->addArg( 'file', 'File containing wikitext (Default: stdin)', false );
}
@@ -127,10 +128,14 @@ class CLIParser extends Maintenance {
* @return ParserOutput
*/
protected function parse( $wikitext ) {
+ $options = new ParserOptions;
+ if ( $this->getOption( 'tidy' ) ) {
+ $options->setTidy( true );
+ }
return $this->parser->parse(
$wikitext,
$this->getTitle(),
- new ParserOptions()
+ $options
);
}
}