title: html entity decode fail with the new lines in textareas
body: <p>when I get a text from a textarea in html like this</p>
  
  <pre><code>&amp;#119;&amp;#97;&amp;#115;&amp;#101;&amp;
  ;#101;&amp;#109;
  </code></pre>
  
  <p>the correct decode is <code>waseem</code></p>
  
  <p>notice the newline , when I decode it I get </p>
  
  <pre><code>wase&amp;;#101;m
  </code></pre>
  
  <p>the newline make errors here , Can I fix it ? I use javascript in the decoding process . </p>
  
  <p>I use this function in decoding</p>
  
  <pre><code>function html_entity_decode(str) {  
   var  ta=document.createElement("textarea");
  
   ta.innerHTML=str.replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;");
  
   return ta.value;       
  }
  </code></pre>