Markup in title is sometimes stripped and sometimes not

Created on 27 July 2022, over 2 years ago
Updated 25 August 2024, 8 months ago

Problem/Motivation

#3194923: Title is sometimes not rendered as plain string solved the issue with render-arrays sometimes sneaking into the title. That's fine. But we still have two code-paths:

    $title = $this->titleResolver->getTitle($request, $route_match->getRouteObject());
    if (is_array($title)) {
      $title = strip_tags($this->renderer->renderRoot($title));
    }

The first path may result to HTML tags in titles, while the second one is stripping it. We should be consistent in whether the title could contain html tags or not.

Steps to reproduce

Use layout builder, press preview.

Proposed resolution

Support html tags in titles as Drupal does.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇹Austria fago Vienna

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024