How to make wrapper title HTML in 3.x?

In version 2.x it was easy, just add |unescape:html next to $title, but in version 3 there is ia trim function I cannot pass. It trims the long code like a href, and html is useless. The code is:

```php

{if $content|trim}

{if $anchor}



{/if}


{if $title || $smarty.capture.title|trim}


{hook name="wrapper:mainbox_general_title"}
{if $smarty.capture.title|trim}
{$smarty.capture.title}
{else}
{$title|unescape:html}
{/if}
{/hook}


{/if}
{$content|unescape}


{/if}
```
This makes title to be html but the trim eliminate the rest of the code.
And I try to eliminate the trim from this code but it does not work. Any help?