Had a search through the archive but can't find what I'm looking for, so here goes.
If tmpl_str="It's a wonderful life"
Then my resultant html is
This is obviously broken due to the unescaped single quote in It's. The same would apply if the js string assignment was enclosed in double quotes and I included doulble quotes in my tmp_str value.
What I really need to do is:
tmpl_str=It\'s a wonderful life
and all would be well.
1) I am working with db data and am not aware of what chars data values contain.
2) I am using the same data values in different places within the same template and do not want escaped quotes in all cases.
These two cases make it very messy to filter my datasets and escape here, there and everywhere.
Any ideas? Is there a simple solution or would a escape=quotes patch be the way to go?
Thanks in advance