mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-27 17:01:07 +00:00
Merge "Enable restBaseless rendering"
This commit is contained in:
commit
090c6c0b0b
|
@ -121,6 +121,10 @@
|
|||
"description": "Determine which TexVC variant is used, currently available: 'mathoid', 'restbase' (default) and 'local'.",
|
||||
"value": "restbase"
|
||||
},
|
||||
"MathSvgRenderer": {
|
||||
"description": "Determine which SVG rendering service is used. Currently available 'mathoid', 'restbase'.",
|
||||
"value": "restbase"
|
||||
},
|
||||
"MathLaTeXMLTimeout": {
|
||||
"value": 240
|
||||
},
|
||||
|
|
|
@ -77,6 +77,7 @@ class ParserHooksHandler implements
|
|||
* @return array|string
|
||||
*/
|
||||
public function mathTagHook( ?string $content, array $attributes, Parser $parser ) {
|
||||
global $wgMathSvgRenderer;
|
||||
$mode = $parser->getOptions()->getOption( 'math' );
|
||||
if ( $mode === MathConfig::MODE_NATIVE_JAX ) {
|
||||
$parser->getOutput()->addModules( [ 'ext.math.mathjax' ] );
|
||||
|
@ -88,7 +89,7 @@ class ParserHooksHandler implements
|
|||
if ( array_key_exists( "qid", $attributes ) ) {
|
||||
$parser->getOutput()->addModules( [ 'ext.math.popup' ] );
|
||||
}
|
||||
if ( $mode == MathConfig::MODE_MATHML ) {
|
||||
if ( $wgMathSvgRenderer === 'restbase' && $mode == MathConfig::MODE_MATHML ) {
|
||||
$marker = Parser::MARKER_PREFIX .
|
||||
'-postMath-' . sprintf( '%08X', $this->mathTagCounter++ ) .
|
||||
Parser::MARKER_SUFFIX;
|
||||
|
|
|
@ -136,10 +136,11 @@ class MathMathML extends MathRenderer {
|
|||
}
|
||||
|
||||
public function render() {
|
||||
global $wgMathFullRestbaseURL;
|
||||
global $wgMathFullRestbaseURL, $wgMathSvgRenderer;
|
||||
try {
|
||||
if ( in_array( $this->inputType, $this->restbaseInputTypes, true ) &&
|
||||
in_array( $this->mode, $this->restbaseRenderingModes, true )
|
||||
if ( $wgMathSvgRenderer === 'restbase' &&
|
||||
in_array( $this->inputType, $this->restbaseInputTypes, true ) &&
|
||||
in_array( $this->mode, $this->restbaseRenderingModes, true )
|
||||
) {
|
||||
if ( !$this->rbi ) {
|
||||
$this->rbi =
|
||||
|
|
Loading…
Reference in a new issue