title: SyntaxError: unterminated string literal strange error
body: <p>I have this strange unterminated string literal error in JavaScript. When I output only a single word like "php" (in the cache_open.handler variable). There is no error. This is the script and below works fine:</p>
  
  <pre><code>        &lt;script&gt;
          var cache_open = {};
          var cache_name_open={};         
          var handler='open';
          cache_open.handler='&lt;pre class="brush: html;"&gt;php&lt;/pre&gt;';           
          cache_name_open.handler='PHP prepared statement';           
          &lt;/script&gt;
  </code></pre>
  
  <p>However when I output a code (html entity outputted source code) to the culprit variable cache_open.handler, it returns unterminated string literal error in the console.</p>
  
  <p>This is the sample output where it returns an error:</p>
  
  <pre><code>        &lt;script&gt;
          var cache_open = {};
          var cache_name_open={};         
          var handler='open';
         cacheObj_open.handler='&lt;pre class="brush: html;"&gt;
         &amp;lt;?php
         $stmt = $dbh-&amp;gt;prepare(&amp;quot;SELECT * FROM REGISTRY where name = ?&amp;quot;);
         if ($stmt-&amp;gt;execute(array($_GET['name']))) {
         while ($row = $stmt-&amp;gt;fetch()) {
         print_r($row);
         }
         }
         ?&amp;gt;&lt;/pre&gt;';            
      cache_name_open.handler='PHP prepared statement';           
          &lt;/script&gt;
  </code></pre>
  
  <p>At first I thought it was just the complexity of the code returned (for example containing quotes, etc.). But even a simple HTML code also returns an error:</p>
  
  <pre><code>        &lt;script&gt;
          var cache_open = {};
          var cache_name_open={};         
          var handler='open';
          cacheObj_open.handler='&lt;pre class="brush: html;"&gt;&amp;lt;html&amp;gt;
          &amp;lt;body&amp;gt;
          &amp;lt;p&amp;gt;Hello world.&amp;lt;/p&amp;gt;
          &amp;lt;/body&amp;gt;
          &amp;lt;/html&amp;gt;&lt;/pre&gt;';           
      cache_name_open.handler='PHP prepared statement';           
          &lt;/script&gt;
  </code></pre>
  
  <p>Any ideas what is causing the error? Any suggestions for modifications is highly appreciated thanks!</p>