mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 07:34:22 +00:00
Merge "Remove redundant ExtensionRegistry callback"
This commit is contained in:
commit
92cc03d300
|
@ -11,7 +11,6 @@
|
|||
"url": "https://www.mediawiki.org/wiki/Extension:Math",
|
||||
"descriptionmsg": "math-desc",
|
||||
"license-name": "GPL-2.0-or-later",
|
||||
"callback": "MathHooks::registerExtension",
|
||||
"type": "parserhook",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.35.0"
|
||||
|
@ -95,6 +94,7 @@
|
|||
}
|
||||
},
|
||||
"MathDisableTexFilter": {
|
||||
"description": "To access this at run-time, use MathRenderer::getDisableTexFilter(). Do not use the non-normalized configuration directly.",
|
||||
"value": "new"
|
||||
},
|
||||
"MathEnableExperimentalInputFormats": {
|
||||
|
@ -122,6 +122,7 @@
|
|||
"value": false
|
||||
},
|
||||
"MathValidModes": {
|
||||
"description": "To access this at run-time, use MathRenderer::getValidModes(). Do not use the non-normalized configuration directly.",
|
||||
"value": [
|
||||
"png",
|
||||
"source",
|
||||
|
|
|
@ -252,7 +252,8 @@ class MathHooks {
|
|||
if ( !in_array( $mode, $validModes ) ) {
|
||||
LoggerFactory::getInstance( 'Math' )->error( 'Misconfiguration: ' .
|
||||
"\$wgDefaultUserOptions['math'] is not in [ " . implode( ', ', $validModes ) . " ].\n" .
|
||||
"Please check your LocalSetting.php file." );
|
||||
"Please check your LocalSettings.php file."
|
||||
);
|
||||
// Display the checkbox in the first option.
|
||||
$wgDefaultUserOptions['math'] = $validModes[0];
|
||||
}
|
||||
|
@ -368,16 +369,6 @@ class MathHooks {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static function registerExtension() {
|
||||
global $wgDefaultUserOptions, $wgMathValidModes, $wgMathDisableTexFilter;
|
||||
$wgMathValidModes = MathRenderer::getValidModes();
|
||||
if ( $wgMathDisableTexFilter === true ) { // ensure backwards compatibility
|
||||
$wgMathDisableTexFilter = 'never';
|
||||
}
|
||||
$wgMathDisableTexFilter = MathRenderer::getDisableTexFilter();
|
||||
$wgDefaultUserOptions['math'] = self::mathModeToString( $wgDefaultUserOptions['math'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function for the <ce> parser hook.
|
||||
*
|
||||
|
|
|
@ -716,6 +716,10 @@ abstract class MathRenderer {
|
|||
|
||||
public static function getDisableTexFilter() {
|
||||
global $wgMathDisableTexFilter;
|
||||
if ( $wgMathDisableTexFilter === true ) {
|
||||
// ensure backwards compatibility
|
||||
$wgMathDisableTexFilter = 'never';
|
||||
}
|
||||
return MathHooks::mathCheckToString( $wgMathDisableTexFilter );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue