returning HTML in $event->sender->addErrors doesn't work I have a plugin which is checking if there is a duplicate entry before save. I'm trying to give the user back an anchor to the entry which exists so my client can switch without searching for it in a giant structure.
I have this code
$event-&gt;sender-&gt;addErrors([
    'expiryDate' =&gt; '&lt;a href='.$entry[0]-&gt;cpEditUrl.'&gt;'.$entry[0]-&gt;title.'&lt;/a&gt;'
]);

But somehow I can't render the HTML correctly in the Control Panel, it's getting displayed as plain tekst. Is there any way to achieve this?
Allright, after digging &amp; debugging a bit further into this issue I found it out myself!
$event-&gt;sender-&gt;addErrors([
    'expiryDate' =&gt; Template::raw('&lt;a href='.$entry[0]-&gt;cpEditUrl.'&gt;'.$entry[0]-&gt;title.'&lt;/a&gt;')
]);

PS: don't forget to add this to the top of your php file:
use craft\helpers\Template;