Resource record title with Html

I have a hotels resource, where some of the hotels have HTML inside their name, like Hotel XY <sup>Superior</sup>. On edit pages and inside the breadcrumb, this looks obviously uggly, since its rendered htmlencoded. I tried to make the record title a HtmlString:

    public static function getRecordTitle(?Model $record): ?string
    {
        return new HtmlString($record->name);
    }


But this doesn't work, neither in the HotelResource nor in the EditHotel class. Any ideas or isn't it just not possible?
Was this page helpful?