MDL-48955 filter_mathjax: Regexp fix for texfiltercompatibility mode

Fixing incorrect regexp for replacing text like
"$$a$$ and $$b$$" to "\(a\) and \(b\)". This is needed for
texfiltercompatibility to work as expected.
This commit is contained in:
Vadim Dvorovenko
2015-01-29 23:17:22 +07:00
parent 4c27f52d91
commit 6aec17bd00
+1 -1
View File
@@ -143,7 +143,7 @@ class filter_mathjaxloader extends moodle_text_filter {
$text = str_replace('[tex]', '\\(', $text);
$text = str_replace('[/tex]', '\\)', $text);
// E.g. "$$ blah $$".
$text = preg_replace('|\$\$[\S\s]\$\$|u', '\\(\1\\)', $text);
$text = preg_replace('|\$\$([\S\s]*?)\$\$|u', '\\(\1\\)', $text);
// E.g. "\[ blah \]".
$text = str_replace('\\[', '\\(', $text);
$text = str_replace('\\]', '\\)', $text);