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() );
}
/**
* @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
);
}
}