MDL-86468 filter_mathjaxloader: Upgrade MathJax to 4.0.0

This commit is contained in:
Muhammad Arnaldo
2025-11-18 10:27:25 +07:00
parent a331b32bef
commit cc52ae3e33
5 changed files with 48 additions and 31 deletions
+11 -6
View File
@@ -27,12 +27,6 @@
* @return bool result
*/
function xmldb_filter_mathjaxloader_upgrade($oldversion) {
// Automatically generated Moodle v4.2.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v4.3.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v4.4.0 release upgrade line.
// Put any upgrade step following this.
@@ -57,5 +51,16 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) {
// Automatically generated Moodle v5.1.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2025111100) {
// Set value of "httpsurl" to the latest MathJax cdn version 4.0.0.
set_config('httpsurl', 'https://cdn.jsdelivr.net/npm/[email protected]/tex-mml-chtml.js', 'filter_mathjaxloader');
// Set the "mathjaxconfig" value to empty due to default config has been set by default.
set_config('mathjaxconfig', '', 'filter_mathjaxloader');
// Main savepoint reached.
upgrade_plugin_savepoint(true, 2025111100, 'filter', 'mathjaxloader');
}
return true;
}
@@ -1,7 +1,7 @@
Description of MathJAX library integration in Moodle
====================================================
* Default MathJax version: 3.2.2
* Default MathJax version: 4.0.0
* License: Apache 2.0
* Source: https://www.mathjax.org/
@@ -24,6 +24,8 @@ Upgrading the default MathJax version
Changes
-------
* Updated to the 4.0.0 version. See MDL-86468 for details.
* Updated to the 3.2.2 version. See MDL-75486 for details
* Updated to the 2.7.9 version. See MDL-70317 for details.
+31 -22
View File
@@ -25,36 +25,45 @@
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
$item = new admin_setting_heading('filter_mathjaxloader/localinstall',
new lang_string('localinstall', 'filter_mathjaxloader'),
new lang_string('localinstall_help', 'filter_mathjaxloader'));
$item = new admin_setting_heading(
'filter_mathjaxloader/localinstall',
new lang_string('localinstall', 'filter_mathjaxloader'),
new lang_string('localinstall_help', 'filter_mathjaxloader')
);
$settings->add($item);
$item = new admin_setting_configtext('filter_mathjaxloader/httpsurl',
new lang_string('httpsurl', 'filter_mathjaxloader'),
new lang_string('httpsurl_help', 'filter_mathjaxloader'),
'https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-mml-chtml.js',
PARAM_RAW);
$item = new admin_setting_configtext(
'filter_mathjaxloader/httpsurl',
new lang_string('httpsurl', 'filter_mathjaxloader'),
new lang_string('httpsurl_help', 'filter_mathjaxloader'),
'https://cdn.jsdelivr.net/npm/[email protected]/tex-mml-chtml.js',
PARAM_RAW
);
$settings->add($item);
$item = new admin_setting_configcheckbox('filter_mathjaxloader/texfiltercompatibility',
new lang_string('texfiltercompatibility', 'filter_mathjaxloader'),
new lang_string('texfiltercompatibility_help', 'filter_mathjaxloader'),
0);
$item = new admin_setting_configcheckbox(
'filter_mathjaxloader/texfiltercompatibility',
new lang_string('texfiltercompatibility', 'filter_mathjaxloader'),
new lang_string('texfiltercompatibility_help', 'filter_mathjaxloader'),
0
);
$settings->add($item);
$item = new admin_setting_configtextarea('filter_mathjaxloader/mathjaxconfig',
new lang_string('mathjaxsettings','filter_mathjaxloader'),
new lang_string('mathjaxsettings_desc', 'filter_mathjaxloader'),
'');
$item = new admin_setting_configtextarea(
'filter_mathjaxloader/mathjaxconfig',
new lang_string('mathjaxsettings', 'filter_mathjaxloader'),
new lang_string('mathjaxsettings_desc', 'filter_mathjaxloader'),
''
);
$settings->add($item);
$item = new admin_setting_configtext('filter_mathjaxloader/additionaldelimiters',
new lang_string('additionaldelimiters', 'filter_mathjaxloader'),
new lang_string('additionaldelimiters_help', 'filter_mathjaxloader'),
'',
PARAM_RAW);
$item = new admin_setting_configtext(
'filter_mathjaxloader/additionaldelimiters',
new lang_string('additionaldelimiters', 'filter_mathjaxloader'),
new lang_string('additionaldelimiters_help', 'filter_mathjaxloader'),
'',
PARAM_RAW
);
$settings->add($item);
}
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2025100600;
$plugin->version = 2025111100;
$plugin->requires = 2025092600; // Requires this Moodle version.
$plugin->component= 'filter_mathjaxloader';
@@ -14,7 +14,8 @@ Feature: Equation editor
And I click on the "Equation editor" button for the "Description" TinyMCE editor
And the "class" attribute of "Edit equation using" "field" should contain "text-ltr"
And I set the field "Edit equation using" to " = 1 \div 0"
And I click on "\infty" "button"
# The normal pointer click no longer reaches the button in MathJax 4.0.0. Force the click via JS instead.
And I click on "\infty" "button" skipping visibility check
And I click on "Save equation" "button"
And I click on "Update profile" "button"
And I follow "Profile" in the user menu