String.raw equivalent in Internet Explorer?
<p>I am returning a DTML Template generated using Python's Zope and assigning it a JS variable by evaluating it in browser. My template would look like:</p>

<pre><code>var html = &lt;dtml-var "html"&gt;

# which is nothing but
var html = "&lt;html&gt;
&lt;body&gt;
Hello
&lt;/body&gt;
&lt;/html&gt;
"
</code></pre>

<p>This is not valid since Javascript expects double quotes to close before a newline character as explained in some questions like <a href="https://stackoverflow.com/questions/10154429/javascript-string-with-new-line-but-not-using-n">JavaScript string with new line - but not using \n</a>.</p>

<p>I figured that I could actually do:</p>

<pre><code>var html = String.raw`&lt;dtml-var "html"&gt;` 
</code></pre>

<p>which works in Chrome, however <code>String.raw</code> doesn't exist in <code>IE 11</code>.
  Are there any alternatives that I can use?</p>

<p>Alternatively, can I fix this problem in Python by doing the below snippet? Are there any caveats to be aware of?</p>

<pre><code># Replace newline character to \n literally.
html.replace("\n",\\n")

# Escape the double quotes
html.replace("\n",\\n").replace("\"", "\\\"") i.e replace " with \"
</code></pre>