title: White space not removing when using firefox with clipbord js
body: <p>I am using clipbord.js When I click on my button and copy the code and then paste it some where it leaves quite a large gap at the top</p>
  <p>I have tried using <code>.replace(/\s/g, &quot;&quot;)</code> on here</p>
  <p><a href="http://codepen.io/riwakawebsitedesigns/pen/rrxEyQ" rel="nofollow noreferrer">Codepen Example</a> <em><strong>--&gt; Link has been updated with working code</strong></em></p>
  <blockquote>
  <p>Question: When use firefox how to make sure that there is no gap when I have copied the code and then go to paste it.</p>
  <p>There is no gap when I use <strong>Google Chrome</strong>, <strong>Edge</strong>, <strong>Internet Explore</strong></p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/NO8GW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NO8GW.png" alt="enter image description here" /></a></p>
  <pre><code>$(document).ready(function() {  
      new Clipboard(&quot;#copy-button&quot;, {
          text: function(trigger) {
              var str = $(trigger).parent().find('pre').text();
              return str.replace(/\s/g, &quot;&quot;);
          }
      });
  });
  </code></pre>
  <p>HTML</p>
  <pre><code>&lt;div class=&quot;container&quot;&gt;
    
  &lt;div class=&quot;row&quot;&gt;
  &lt;div class=&quot;col-lg-12 col-md-12 col-sm-12 col-xs-12&quot;&gt;
    &lt;div class=&quot;page-header&quot;&gt;&lt;h1&gt;Clean URLs&lt;/h1&gt;&lt;/div&gt;  
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class=&quot;row&quot;&gt;
  
  &lt;div class=&quot;col-lg-6 col-md-6 col-sm-12 col-xs-12&quot;&gt;
  &lt;div class=&quot;panel panel-default&quot;&gt;
  &lt;div class=&quot;panel-heading&quot;&gt;
  &lt;div class=&quot;clearfix&quot;&gt;
  &lt;div class=&quot;pull-left&quot; style=&quot;padding-top: 7.5px;&quot;&gt;
  &lt;h1 class=&quot;panel-title&quot;&gt;Example 1&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div class=&quot;pull-right&quot;&gt;
  &lt;button type=&quot;button&quot; id=&quot;copy-button&quot; data-clipboard-target=&quot;#h1&quot; class=&quot;btn btn-primary&quot;&gt;&lt;i class=&quot;fa fa-clipboard&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;Copy&lt;/button&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class=&quot;panel-body&quot;&gt;
  &lt;pre id=&quot;h1&quot;&gt;
  Options +FollowSymLinks
  Options -Indexes
  DirectoryIndex index.php
  RewriteEngine on
  RewriteCond $1 !^(index\.php|images|robots\.txt)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
  &lt;/pre&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;div class=&quot;col-lg-6 col-md-6 col-sm-12 col-xs-12&quot;&gt;
  &lt;div class=&quot;panel panel-default&quot;&gt;
  &lt;div class=&quot;panel-heading&quot;&gt;
  &lt;div class=&quot;clearfix&quot;&gt;
  &lt;div class=&quot;pull-left&quot; style=&quot;padding-top: 7.5px;&quot;&gt;
  &lt;h1 class=&quot;panel-title&quot;&gt;Example 2&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div class=&quot;pull-right&quot;&gt;
  &lt;button type=&quot;button&quot; id=&quot;copy-button&quot; data-clipboard-target=&quot;#h2&quot; class=&quot;btn btn-primary&quot;&gt;&lt;i class=&quot;fa fa-clipboard&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;Copy&lt;/button&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class=&quot;panel-body&quot;&gt;
  &lt;pre id=&quot;h2&quot;&gt;
  RewriteEngine On
  RewriteBase /root_folder_name/
  RewriteCond %{REQUEST_URI} ^system.*
  RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
  RewriteRule ^(.*)$ /index.php/$1 [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L]
  &lt;/pre&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  
  
  &lt;/div&gt;
  </code></pre>