<div dir="ltr">You could solve this in one of two ways:<div><br></div><div>1. Switch over to embedding `t` as JSON and concatenating in Javascript, e.g.: [julius| str = &quot;a&quot; + #{toJSON t} + &quot;bc&quot;|]. I think we never ended up adding the aeson instances to shakespeare-js, but I&#39;m in favor of doing so.</div>

<div>2. Writing some escape algorithm on the characters. This would be more complicated.</div><div><br></div><div>The reason we haven&#39;t implemented the idea that Greg mentions is that it prevents certain use cases, such as interpolating actual Javascript code.</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 14, 2012 at 12:08 PM, Dmitry Vyal <span dir="ltr">&lt;<a href="mailto:akamaus@gmail.com" target="_blank">akamaus@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Greetings<br>
<br>
Recently I stumbled upon an unexpected escaping problem. I hoped Shakespeare templates would solve these forever, but looks like it&#39;s not the case.<br>
<br>
For example, look at this snippet:<br>
Prelude Text.Julius Data.Text.Lazy Data.Text&gt; let t = &quot;X\&quot;Y\&quot;Z&quot;; j = [julius| str = &quot;a#{t}bc&quot;; |] in putStrLn $ Data.Text.Lazy.unpack $  renderJavascriptUrl (\u env -&gt; Data.Text.pack &quot;&quot;) j<br>


 str = &quot;aX&quot;Y&quot;Zbc&quot;;<br>
<br>
Clearly we have have a problem here. Can something be done with it?<br>
<br>
Best wishes,<br>
Dmitry<br>
<br>
______________________________<u></u>_________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org" target="_blank">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/web-devel</a><br>
</blockquote></div><br></div>