From: Subramanya Sastry Date: Sun, 12 Mar 2017 22:13:51 +0000 (-0500) Subject: Add --tidy option to maintenance/parse.php X-Git-Tag: 1.31.0-rc.0~3811^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=ab68d05cc4330c7cd6fea565bf5ad96beff7e00f Add --tidy option to maintenance/parse.php Change-Id: I6ec08237bd15ee2d824164a0493b7fff9ef312db --- 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 ); } }