Another option if this is needed, is to find somewhere to add in an addslahses() wrapped version of the template that can be accessed by the smarty templates. Otherwise each time the template is saved another layer of slashes is removed breaking any escaped characters in the template.