title: Cannot read property of NULL
body: <p>I have the following html file in which I try to highlight some code using a web worker:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link rel="stylesheet" href="./highlight/styles/default.css"&gt;
  &lt;script src="./highlight/highlight.pack.js"&gt;&lt;/script&gt;
  
  &lt;script src="http://code.jquery.com/jquery-1.11.0.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  
   if (typeof(Worker) !== "undefined") {
  
       addEventListener('load', function() {
     var code = document.querySelector('#code');
     var worker = new Worker('worker.js');
     worker.onmessage = function(event) { code.innerHTML = event.data; }
     worker.postMessage(code.textContent);
    })
   
   } else {
   }
  
  
  &lt;/script&gt;
  
  
  &lt;pre&gt;&lt;code&gt;
  // This is a generated file with many packages
  `ifdef MACRO_1
  `else
  package pkg_1;
    typedef logic [1:0] t;
    typedef enum t {
        IDLE = 2'd0
      , ARMED = 2'd1
      , WRITE = 2'd2
      , BUSY = 2'd3
    } e;
  &lt;/code&gt;&lt;/pre&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But I get an error saying: Uncaught TypeError: Cannot read property 'textContent' of null (worker.postMessage(content.textContent));</p>
  
  <p>Is there a solution?</p>