title: Replacing apostrophe in string
body: <p>I'm using phonegap to share an article via WhatsApp.</p>
  
  <p>The code for the button is as follows:</p>
  
  <pre><code>    shareArticle += '&lt;li class="rrssb-whatsapp"&gt;&lt;a href="javascript: void(1)" onclick="window.plugins.socialsharing.shareViaWhatsApp(\''+$('.article_title').html().replace(/'/g, "&amp;apos;")+'\', null, \'http://www.myaddress.com/showArticle-'+articleId+'\', function() {console.log(\'share ok\')}, function(errormsg){alert(errormsg)});" class="popup" data-action="share/whatsapp/share"&gt;';
      shareArticle += '&lt;span class="rrssb-icon"&gt;&lt;!-- Icon in SVG --&gt;&lt;/span&gt;';
      shareArticle += '&lt;/a&gt;&lt;/li&gt;';
  </code></pre>
  
  <p>The part that I'm asking about is this:</p>
  
  <pre><code>onclick="window.plugins.socialsharing.shareViaWhatsApp(\''+$('.article_title').html().replace(/'/g, "&amp;apos;")+'\', null, \'http://www.myaddress.com/showArticle-'+articleId+'\', function() {console.log(\'share ok\')}, function(errormsg){alert(errormsg)});"
  </code></pre>
  
  <p>The button is not working when there is an apostrophe in the title.</p>
  
  <p>The strangest thing is that if I replace <code>&amp;apos;</code> with <code>&amp;quot;</code> it work perfectly (even thought the result is wrong).</p>
  
  <p>Doe's anybody has any idead why <code>&amp;apos;</code> fails?</p>