Travis Basevi wrote:
> Yes, I know that solution, but lets say the text comes from a database 
> or some other source rather than being hardcoded in the template. Is 
> there a more general/correct solution than something along the lines of:
> 
> b.replace('_err_', a.replace('$','\$'));

I think you would need

 b.replace('_err_', a.replace('$','\\\$'));

but why not avoid the whole problem:

[%
   a = 'this problem will cost me $50 million to fix';
   b = 'WARNING:';
   b ; a ;
%]

or even:

[%
   a = 'this problem will cost me $50 million to fix';
   'WARNING:'; a;
%]

Cheers, Dave

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to