mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 23:25:02 +00:00
Merge "Human-readable errors on Special:MathStatus"
This commit is contained in:
commit
90264e311b
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace MediaWiki\Extension\Math\Widget;
|
namespace MediaWiki\Extension\Math\Widget;
|
||||||
|
|
||||||
|
use MediaWiki\Extension\Math\MathConfig;
|
||||||
use MediaWiki\Extension\Math\Render\RendererFactory;
|
use MediaWiki\Extension\Math\Render\RendererFactory;
|
||||||
use MediaWiki\Extension\Math\SpecialMathStatus;
|
use MediaWiki\Extension\Math\SpecialMathStatus;
|
||||||
use OOUIHTMLForm;
|
use OOUIHTMLForm;
|
||||||
|
@ -74,8 +75,13 @@ class MathTestInputForm extends OOUIHTMLForm {
|
||||||
$options['display'] = $formData['display'];
|
$options['display'] = $formData['display'];
|
||||||
}
|
}
|
||||||
$renderer = $this->rendererFactory->getRenderer( $formData['tex'], $options, $mode );
|
$renderer = $this->rendererFactory->getRenderer( $formData['tex'], $options, $mode );
|
||||||
$renderer->render();
|
if ( ( $mode === MathConfig::MODE_SOURCE || $renderer->checkTeX() )
|
||||||
$out->addHTML( $renderer->getHtmlOutput() );
|
&& $renderer->render() ) {
|
||||||
|
$html = $renderer->getHtmlOutput();
|
||||||
|
} else {
|
||||||
|
$html = $renderer->getLastError();
|
||||||
|
}
|
||||||
|
$out->addHTML( $html );
|
||||||
$out->addWikiMsgArray( 'math-test-end', [ $modeName ] );
|
$out->addWikiMsgArray( 'math-test-end', [ $modeName ] );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue