From ae16bcd7e577999d51a5a77e57da13c3038340ea Mon Sep 17 00:00:00 2001
From: Lauri Eskola <lauri.eskola@acquia.com>
Date: Thu, 16 Feb 2023 09:35:37 +0200
Subject: [PATCH] Issue #3255895 by jrb, murilohp, harshitthakore, lauriii,
 xjm: HTML entities in Tour tip labels get double-escaped

---
 core/modules/tour/src/TourViewBuilder.php           | 2 +-
 core/modules/tour/tests/src/Functional/TourTest.php | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/modules/tour/src/TourViewBuilder.php b/core/modules/tour/src/TourViewBuilder.php
index 61e17a732e30..105563ad5fcc 100644
--- a/core/modules/tour/src/TourViewBuilder.php
+++ b/core/modules/tour/src/TourViewBuilder.php
@@ -60,7 +60,7 @@ public function viewMultiple(array $entities = [], $view_mode = 'full', $langcod
           $body = (string) \Drupal::service('renderer')->renderPlain($body_render_array);
           $output = [
             'body' => $body,
-            'title' => Html::escape($tip->getLabel()),
+            'title' => $tip->getLabel(),
           ];
 
           $selector = $tip->getSelector();
diff --git a/core/modules/tour/tests/src/Functional/TourTest.php b/core/modules/tour/tests/src/Functional/TourTest.php
index 32e958dbbd62..aaf2a781a283 100644
--- a/core/modules/tour/tests/src/Functional/TourTest.php
+++ b/core/modules/tour/tests/src/Functional/TourTest.php
@@ -158,7 +158,7 @@ public function testTourFunctionality() {
         'tour-test-1' => [
           'id' => 'tour-code-test-1',
           'plugin' => 'text',
-          'label' => 'The rain in spain',
+          'label' => 'The rain in spain is <strong>strong</strong>',
           'body' => 'Falls mostly on the plain.',
           'weight' => '100',
           'selector' => '#tour-code-test-1',
@@ -194,7 +194,7 @@ public function testTourFunctionality() {
 
     $elements = $this->findTip([
       'id' => 'tour-code-test-1',
-      'title' => 'The rain in spain',
+      'title' => 'The rain in spain is <strong>strong</strong>',
     ]);
     $this->assertCount(1, $elements, 'Found the required tip markup for tip 4');
 
-- 
GitLab