Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix escaping of \\ #3993

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Services/MathJax/classes/class.ilMathJax.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,15 @@ public function insertLatexImages($a_text, $a_start = '[tex]', $a_end = '[/tex]'
}

// omit the html newlines added by the ILIAS page editor
// handle custom newlines in JSMath (still needed?)
$tex = str_replace('<br>', '', $tex);
$tex = str_replace('<br/>', '', $tex);
$tex = str_replace('<br />', '', $tex);
$tex = str_replace('\\\\', '\\cr', $tex);

// check, if tags go across div borders
if (is_int(ilStr::strPos($tex, '<div>')) || is_int(ilStr::strPos($tex, '</div>'))) {
// keep the original including delimiters, continue search behind
$cpos = $epos + ilStr::strLen($a_end);
}
else {
} else {
switch ($this->engine) {
case self::ENGINE_CLIENT:
// prepare code for processing in the browser
Expand Down Expand Up @@ -393,8 +390,7 @@ public function insertLatexImages($a_text, $a_start = '[tex]', $a_end = '[/tex]'
// continue search behind replacement
$cpos = $spos + ilStr::strLen($replacement);
}
}
else {
} else {
// end delimiter position not found => stop search
break;
}
Expand Down