X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fparse.php;h=43bbca1177864055e44958be09a4ff4f95b85d55;hb=34bd6f0b6bd0f0af03b448deddb85cdea358e0fb;hp=d9a247c354cb9804592ec1e836bf2a7d8bbcad54;hpb=bca608592079a5f8697ad35ad3188b62b73859d9;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parse.php b/maintenance/parse.php index d9a247c354..43bbca1177 100644 --- a/maintenance/parse.php +++ b/maintenance/parse.php @@ -71,7 +71,7 @@ class CLIParser extends Maintenance { false, true ); - $this->addOption( 'tidy', 'Tidy the output' ); + $this->addOption( 'no-tidy', 'Don\'t tidy the output (deprecated)' ); $this->addArg( 'file', 'File containing wikitext (Default: stdin)', false ); } @@ -85,7 +85,7 @@ class CLIParser extends Maintenance { * @return string HTML Rendering */ public function render( $wikitext ) { - return $this->parse( $wikitext )->getText(); + return $this->parse( $wikitext )->getText( [ 'wrapperDivClass' => '' ] ); } /** @@ -117,9 +117,7 @@ class CLIParser extends Maintenance { * @return Title */ protected function getTitle() { - $title = $this->getOption( 'title' ) - ? $this->getOption( 'title' ) - : 'CLIParser'; + $title = $this->getOption( 'title' ) ?: 'CLIParser'; return Title::newFromText( $title ); } @@ -129,9 +127,10 @@ class CLIParser extends Maintenance { * @return ParserOutput */ protected function parse( $wikitext ) { - $options = new ParserOptions; - if ( $this->getOption( 'tidy' ) ) { - $options->setTidy( true ); + $options = ParserOptions::newCanonical(); + $options->setOption( 'enableLimitReport', false ); + if ( $this->getOption( 'no-tidy' ) ) { + $options->setTidy( false ); } return $this->parser->parse( $wikitext,