X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fparse.php;h=6279a348ac7de78b17905a3fa5db55325f9be4c7;hb=5910fe9d9bdfdef20050694bddc640bcb5ae692c;hp=effed56dcd568bacd0a30237d82856004d9a5d31;hpb=f132746d2882a8383cb6288325aae048b2b996e3;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parse.php b/maintenance/parse.php index effed56dcd..6279a348ac 100644 --- a/maintenance/parse.php +++ b/maintenance/parse.php @@ -68,12 +68,13 @@ class CLIParser extends Maintenance { false, true ); + $this->addOption( 'tidy', 'Tidy the output' ); $this->addArg( 'file', 'File containing wikitext (Default: stdin)', false ); } public function execute() { $this->initParser(); - print $this->render( $this->WikiText() ); + print $this->render( $this->Wikitext() ); } /** @@ -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 ); } }