Skip to content

Commit

Permalink
MDL-78103 filter_mathjaxloader: Fixed replacement of grader or less
Browse files Browse the repository at this point in the history
  • Loading branch information
chen21590 committed Dec 4, 2024
1 parent a798b1d commit 6e6ad01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filter/mathjaxloader/classes/text_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ protected function insert_span($text, $start, $end) {
* @return string Returns the input string with HTML tags escaped.
*/
private function escape_html_tag_wrapper(string $text): string {
return preg_replace_callback('/\{([^}]+)\}/', function (array $matches): string {
return preg_replace_callback('/\{[^}]*<[^}]+>[^}]*\}/', function (array $matches): string {
$search = ['<', '>'];
$replace = ['&lt;', '&gt;'];
return str_replace($search, $replace, $matches[0]);
Expand Down

0 comments on commit 6e6ad01

Please sign in to comment.