mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-09-23 10:21:31 +00:00
Add chem option to texvc binary
Change-Id: Ie74c948de98480592c8e67e36b047393cd563346
This commit is contained in:
parent
1ff7740fa9
commit
ed850f91fe
|
@ -30,6 +30,7 @@ class TexVcCli extends Maintenance {
|
|||
"For valid input, it returns a normalized texvc string, " .
|
||||
"otherwise the error code and detail are shown." );
|
||||
$this->addArg( 'input', 'The tex input to be checked', true );
|
||||
$this->addOption( 'chem', 'Set for chem input', false, false );
|
||||
$this->requireExtension( 'Math' );
|
||||
}
|
||||
|
||||
|
@ -39,7 +40,8 @@ class TexVcCli extends Maintenance {
|
|||
public function execute() {
|
||||
$userInputTex = $this->getArg( 0 );
|
||||
$texvc = new MediaWiki\Extension\Math\TexVC\TexVC();
|
||||
$result = $texvc->check( $userInputTex );
|
||||
$options = [ 'usemhchem' => $this->getOption( 'chem' ) ];
|
||||
$result = $texvc->check( $userInputTex, $options );
|
||||
if ( $result['status'] !== '+' ) {
|
||||
$this->error( $result['status'] . $result['details'] );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue