Oddly it seems that when using {$foo|escape:'quotes'} Smarty will only escape single quotes instead of both single and double quotes. This is problematic with HTML attributes that need the " changed to "e;.
Double quotes can be escaped using {$foo|escape:'html'}, but it doesn't work for single quote.
We can use this way to escape both single and double quotes: {$foo|escape:'quotes'|replace:'"':'"'}
Also, we can write a custom modifier: