Skip to content

Commit

Permalink
Merge pull request #2442 from QuizandSurveyMaster/CU-86cu3vap2-make-t…
Browse files Browse the repository at this point in the history
…inymce-toolbar-options-dynamic

fixed code tag issue
  • Loading branch information
zubairraeen authored Jan 10, 2024
2 parents a30f46c + 1ca397b commit 4f7221f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion php/question-types/qsm-question-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>(.*?)<\/code>/s';
$question_title_modified_html = preg_replace_callback($pattern, function ( $matches ) {
return preg_replace([ '/<(?!(\/?code|br)[ >])/', '/>(?!(\/?code|br)[ \/>])/' ], [ '&lt;', '&gt;' ], $matches[0]);
}, $question_title);
$question_title_modified_html = str_replace([ 'code&gt;', 'br /&gt;' ],[ 'code/>', 'br />' ], $question_title_modified_html );
?>
<p><?php echo do_shortcode( wp_kses( $question_title . $deselect_answer, $allow_html ) ); ?></p>
<p><?php echo do_shortcode( wp_kses( $question_title_modified_html . $deselect_answer, $allow_html ) ); ?></p>
</div>
<?php
do_action('qsm_question_title_func_after',$question, $question_type, $new_question_title, $question_id );
Expand Down

0 comments on commit 4f7221f

Please sign in to comment.