diff --git a/src/block/accordion/index.php b/src/block/accordion/index.php
index c39048c8d..cef9367cf 100644
--- a/src/block/accordion/index.php
+++ b/src/block/accordion/index.php
@@ -94,8 +94,8 @@ public function get_faq_answer( $block, $answer ) {
if ( $count_inner_blocks == 0 ) {
// check if it contains a text
if ( trim( wp_strip_all_tags( $block[ 'innerHTML' ], true ) ) != '' ) {
- // return the text without tags
- return $answer . trim( wp_strip_all_tags( $block[ 'innerHTML'], true ) );
+ // return the text after stripping all tags except
+ return $answer . trim( strip_tags( $block[ 'innerHTML'], ["
"] ) );
}
return $answer;
}
@@ -129,10 +129,10 @@ public function render_block_accordion_faq_schema( $block_content, $block ) {
$this->faq_entities[] = '{
"@type": "Question",
- "name": ' . json_encode( $question ) . ',
+ "name": ' . json_encode( $question, JSON_UNESCAPED_UNICODE ) . ',
"acceptedAnswer": {
"@type": "Answer",
- "text": ' . json_encode( $answer ) .'
+ "text": ' . json_encode( $answer, JSON_UNESCAPED_UNICODE ) .'
}
}';
}