dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "rdbms: IDatabase interface cleanups"
[lhc/web/wiklou.git]
/
maintenance
/
parse.php
diff --git
a/maintenance/parse.php
b/maintenance/parse.php
index
17a8d2e
..
b87a716
100644
(file)
--- a/
maintenance/parse.php
+++ b/
maintenance/parse.php
@@
-68,6
+68,7
@@
class CLIParser extends Maintenance {
false,
true
);
false,
true
);
+ $this->addOption( 'tidy', 'Tidy the output' );
$this->addArg( 'file', 'File containing wikitext (Default: stdin)', false );
}
$this->addArg( 'file', 'File containing wikitext (Default: stdin)', false );
}
@@
-127,13
+128,17
@@
class CLIParser extends Maintenance {
* @return ParserOutput
*/
protected function parse( $wikitext ) {
* @return ParserOutput
*/
protected function parse( $wikitext ) {
+ $options = new ParserOptions;
+ if ( $this->getOption( 'tidy' ) ) {
+ $options->setTidy( true );
+ }
return $this->parser->parse(
$wikitext,
$this->getTitle(),
return $this->parser->parse(
$wikitext,
$this->getTitle(),
- new ParserOptions()
+ $options
);
}
}
);
}
}
-$maintClass =
"CLIParser"
;
+$maintClass =
CLIParser::class
;
require_once RUN_MAINTENANCE_IF_MAIN;
require_once RUN_MAINTENANCE_IF_MAIN;