diff --git a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php index cd0d482..de4d6bc 100644 --- a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php +++ b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php @@ -195,7 +195,8 @@ protected function prepare(array $main_content, Request $request, RouteMatchInte // Determine the title: use the title provided by the main content if any, // otherwise get it from the routing information. $get_title = function (array $main_content) use ($request, $route_match) { - return isset($main_content['#title']) ? $main_content['#title'] : $this->titleResolver->getTitle($request, $route_match->getRouteObject()); + $this_title = isset($main_content['#title']) ? $main_content['#title'] : $this->titleResolver->getTitle($request, $route_match->getRouteObject()); + return isset($this_title['#markup']) ? $this->renderer->render($this_title, FALSE) : $this_title; }; // If the _controller result already is #type => page, diff --git a/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php b/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php index 5785f8d..e0b41c6 100644 --- a/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php +++ b/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php @@ -190,7 +190,7 @@ public function build() { // Analogously for the page title. if (!$title_block_displayed) { $build['title'] = [ - '#markup' => $this->title, + '#markup' => ['#markup' => $this->title], ]; }