Smarty replace text with double quotes


I have the following string in the smarty (php templating system) variable $test:

<img height="113" width="150" alt="Sunset" src="/test.jpg"/>

I want to add "em" to the height and width like this:

{$test|replace:'" w':'em" w'|replace:'" a':'em" a'}

But this doesn't work… What's the problem and the solution?

Best Solution

You do know ‘em’ units in HTML width/height attributes aren't valid, right? That's CSS only.