From ab68d05cc4330c7cd6fea565bf5ad96beff7e00f Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Sun, 12 Mar 2017 17:13:51 -0500 Subject: [PATCH] Add --tidy option to maintenance/parse.php Change-Id: I6ec08237bd15ee2d824164a0493b7fff9ef312db --- maintenance/parse.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/maintenance/parse.php b/maintenance/parse.php index 17a8d2ebf4..6279a348ac 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 ); } } -- 2.20.1