title: Summernote - Text displayed as raw HTML on validation
body: <p>I am using Codeiginter with Summernote on front end - Now In a form, when some fields are empty, the same page loads with validation checking. I am  using the following JS and CI code: </p>
  
  <pre><code> $(window).load(function(){
          &lt;?php if(isset($article['text']))
           {
           ?&gt;
          $('#summernote').code('&lt;?php echo $article['text'];  ?&gt;');
          &lt;?php } else { ?&gt;
  
          $('#summernote').code('&lt;?php echo $_POST['contents'];  ?&gt;').text();
  
          &lt;?php } ?&gt;
      });
  </code></pre>
  
  <p>Now the issue is when say, validation fails, the above code populates the Summernote editor with RAW HTML instead of formatted HTML as it should </p>
  
  <blockquote>
    <p>This is an example of my first post Pellentesque libero tortor,
    tincidunt et, tincidunt eget, semper nec, quam. Lorem ipsum dolor sit
    amet, consectetuer adipiscing elit. Pellentesque commodo eros a enim.
    Aenean imperdiet. Cras sagittis.<br>Nam at
    tortor in tellus interdum sagittis. Nullam nulla eros, ultricies sit
    amet, nonummy id, imperdiet feugiat, pede. Etiam ut purus mattis
    mauris sodales aliquam. Curabitur blandit mollis lacus. Phasellus
    tempus.<br></p>
  </blockquote>
  
  <p>Any ideas why is this so? I have tried .val and .html  - but they don't work. Kindly help. </p>