MDL-55007 filter_mathjaxloader: Wrap nolink around each expresssion
This commit is contained in:
@@ -163,7 +163,19 @@ class filter_mathjaxloader extends moodle_text_filter {
|
||||
}
|
||||
if ($hasinline || $hasdisplay || $hasextra) {
|
||||
$PAGE->requires->yui_module('moodle-filter_mathjaxloader-loader', 'M.filter_mathjaxloader.typeset');
|
||||
return '<span class="nolink"><span class="filter_mathjaxloader_equation">' . $text . '</span></span>';
|
||||
if ($hasextra) {
|
||||
$text = '<span class="nolink">' + $text + '</span>';
|
||||
} else {
|
||||
if ($hasinline) {
|
||||
$text = preg_replace('/\\\\\\([\S\s]*?\\\\\\)/u',
|
||||
'<span class="nolink">\0</span>', $text);
|
||||
}
|
||||
if ($hasdisplay) {
|
||||
$text = preg_replace('/\$\$[\S\s]*?\$\$|\\\\\\[[\S\s]*?\\\\\\]/u',
|
||||
'<span class="nolink">\0</span>', $text);
|
||||
}
|
||||
}
|
||||
return '<span class="filter_mathjaxloader_equation">' . $text . '</span>';
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user