title: Javascript replace() using html entities not working
body: <p>I've got the following script, which successfully replaces &lt; and > with the code indicated below. The idea here is that a user would put  into the text box if they want "Bold me" to appear bolded on their blog.    </p>
  
  <pre><code>$('.blogbody').each(function() {
    var string = $(this).html();
    $(this).html(string.replace('&amp;lt;', '&lt;span class="bold"&gt;'));
  });
  
  $('.blogbody').each(function() {
    var string = $(this).html();
    $(this).html(string.replace('&amp;gt;', '&lt;/span&gt;'));
  });
  </code></pre>
  
  <p>The problem comes with other html entities. I'm going to simply my example. I want to replace the [ html entity with a paragraph tag, but none of the lines in this script work. I've tried documenting each code that related to the '[' character.</p>
  
  <pre><code>$('.blogbody').each(function() {
    var string = $(this).html();
    $(this).html(string.replace('&amp;#x0005B;', '&lt;p&gt;'));
  });
  
  $('.blogbody').each(function() {
    var string = $(this).html();
    $(this).html(string.replace('&amp;lbrack;', '&lt;p&gt;'));
  });
  
  $('.blogbody').each(function() {
    var string = $(this).html();
    $(this).html(string.replace('&amp;lsqb;', '&lt;p&gt;'));
  });
  
  $('.blogbody').each(function() {
    var string = $(this).html();
    $(this).html(string.replace('&amp;lbrack;', '&lt;p&gt;'));
  });
  </code></pre>
  
  <p>Any thoughts on this would be greatly appreciated! Thanks!</p>