I often use embedded templates, using the embed tag with variables:
{embed="site/main" stuff="{var}"}In the above example, if the {var} contains quotes, the embed fails, e.g.,
if {var} = Pooh’s “favorite” food
I think this ends-up being processed like:
{embed="site/main" stuff="Pooh's "favorite" food"}Which doesn’t work due to the confusion between the text value and the variable assignment syntax.
So, in EE, is there a safe way to put text in embedded variables—e.g., that properly escapes quotes or otherwise avoids conflicts?
Note too that EE’s automatic HTML entity escaping doesn’t match all the cases where I’d like to do this (it does match some). In some cases (e.g., <div class=“example”></div>), I really need the double-quote to be a double-quote in the end.
Thanks!