Add --tidy option to maintenance/parse.php
Change-Id: I6ec08237bd15ee2d824164a0493b7fff9ef312db
This commit is contained in:
parent
dc35b44b20
commit
ab68d05cc4
1 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue