Skip to content
Snippets Groups Projects
Commit 01c14cda authored by Elke Kreim's avatar Elke Kreim
Browse files

Revert "Fix remote url for MathJax"

This reverts commit a55291e2.
parent 6612d3a1
No related branches found
No related tags found
No related merge requests found
......@@ -189,28 +189,9 @@ function stack_cors_link(string $filename): string {
* Gets the URL used for MathJax, might be VLE local.
*/
function stack_get_mathjax_url(): string {
// HSH patch - 2024.05.31: Elke Kreim - elke.kreim@hs-hannover.de
// include fix https://github.com/maths/moodle-qtype_stack/pull/1194/files
// to use local installation of MathHax configured in plugin filter_mathjaxloader
$mathjaxconfigurl = get_config('filter_mathjaxloader', 'httpsurl');
if ($mathjaxconfigurl) {
$questionpos = strpos($mathjaxconfigurl, '?');
if ($questionpos !== false) {
$querystring = substr($mathjaxconfigurl, $questionpos + 1);
$urlstring = substr($mathjaxconfigurl, 0, $questionpos);
parse_str($querystring, $queryparams);
$queryparams = array_merge(['config' => 'TeX-AMS-MML_HTMLorMML'], $queryparams);
$querystring = http_build_query($queryparams, null, '&', PHP_QUERY_RFC3986);
$url = $urlstring . '?' . $querystring;
} else {
$url = $mathjaxconfigurl . '?config=TeX-AMS-MML_HTMLorMML';
}
return $url;
} else {
// TODO: figure out how to support VLE local with CORS.
return 'https://cdn.jsdelivr.net/npm/mathjax@2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
}
}
/*
* Gets the url for MathJax 3.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment