title: Textarea limit enter pressed & trim the white space from new line
body: <p>Sorry im new to JavaScript, currently im facing the issue when user copy an article that contain a lot of new line space. How can I trim it and make it only 1 new line? And how to limit the user to press <kbd>enter</kbd> key (newline)?</p>
  <p>Example when copy some text from other source and paste to textarea it will show up like this:</p>
  <pre><code>This is 
                      //new line 
                     //new line  
                     //new line 
                    //new line 
                    //new line     
  Orange
                    //new line 
                    //new line   
                    //new line  
  Not apple
  </code></pre>
  <p>how to make it like , after copy to textarea / enter from textarea</p>
  <pre><code>This is 
  
  orange
  
  not apple
  </code></pre>
  <p>FIDDLE DEMO =
  <a href="https://jsfiddle.net/dofqLoyu/1/" rel="nofollow noreferrer">FIDDLE</a></p>
  <pre><code>my fiddle output :
  ------------------ 
  This is 
  Orange
  not apple
  
  Expected output : 
  -----------------
  This is 
  
  Orange
  
  not apple
  </code></pre>
  <p>Any helps would be appreciated. Thanks!</p>