title: Call Javascript from HTML component
body: <p>I have an HTML component and a javascript function:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function calculateTime(date1, date2) {
    return date2 - date1;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;span&gt;calculateTime(date1,date2);&lt;/span&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But this just results in the actual text 'calculateTime()' with the two dates in between.
  How do I escape the text and make sure that the function is called?</p>