X-Git-Url: http://git.cyclocoop.org/%24dirpuce/puce%24spip_lang_rtl.gif?a=blobdiff_plain;f=maintenance%2Fparse.php;h=b87a716f622d730e1bdcc00b655b8c93050fd5ed;hb=4b70558f4af2b1c0e88d472922c03d03a0d737c4;hp=17a8d2ebf4f0ba58aaf2e6f6ed4b0aaede2ed653;hpb=2379efaad6bddc93e7f08ca42f017890169b44e4;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parse.php b/maintenance/parse.php index 17a8d2ebf4..b87a716f62 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,13 +128,17 @@ 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 ); } } -$maintClass = "CLIParser"; +$maintClass = CLIParser::class; require_once RUN_MAINTENANCE_IF_MAIN;