Resource view heading html

Is there any way to add html into the heading of resource view.

II want to get something like

<h1>Batch <span class="text-primary">AUDITS_05_10_23</span></h1>

But returning html in the getHeading() function just prints the span mark up.

    public function getHeading(): string
    {
        // Use the field batch_name from the resource as the page heading.
        $heading = 'Batch <span class="text-primary">' . $this->record->batch_name . '</span>';
        return new HtmlString($heading);
    }


Cheers Dan
Solution
Return a new HtmlString('')
Was this page helpful?