diff --git a/php/question-types/qsm-question-title.php b/php/question-types/qsm-question-title.php index b3d2751e6..6ae824674 100644 --- a/php/question-types/qsm-question-title.php +++ b/php/question-types/qsm-question-title.php @@ -51,8 +51,13 @@ function qsm_question_title_func( $question, $question_type = '', $new_question_ $allow_html['input']['id'] = 1; $allow_html['input']['maxlength'] = 1; $allow_html = apply_filters( 'qsm_allow_html_question_title_after', $allow_html, $question_id ); + $pattern = '/(.*?)<\/code>/s'; + $question_title_modified_html = preg_replace_callback($pattern, function ( $matches ) { + return preg_replace([ '/<(?!(\/?code|br)[ >])/', '/>(?!(\/?code|br)[ \/>])/' ], [ '<', '>' ], $matches[0]); + }, $question_title); + $question_title_modified_html = str_replace([ 'code>', 'br />' ],[ 'code/>', 'br />' ], $question_title_modified_html ); ?> -

+