Remove Non Breaking Space from Pagination Jquery
<p>Just when I thought I was done, I found in between my selected pagination '5' for example below, double hard coded non-breaking spaces <code>&amp;nbsp;</code>. I don't have access in the cms to override this, so jquery is required.</p>

<p>What is the solution to be sure the pagination gets selected, not the <code>&amp;nbsp;</code>. Please check out the fiddle so you can demo the exact experience.</p>

<p>fiddle <a href="http://jsfiddle.net/evanmoore/9AMnU/2/" rel="nofollow">http://jsfiddle.net/evanmoore/9AMnU/2/</a></p>

<p>HTML</p>

<pre><code>&lt;a href="http://www.example.com"&gt;4&lt;/a&gt;
&amp;nbsp;5&amp;nbsp;
&lt;a href="http://www.example.com"&gt;6&lt;/a&gt;
</code></pre>

<p>This jquery cleans up and span tags around the pagination</p>

<pre><code>$('.pag').each(function () {
  $(this).contents().filter(function () {
    return this.nodeType === 3 &amp;&amp; $.trim(this.textContent) !== '' 
  }).first().wrap('&lt;div/&gt;').parent().html(function (i, v) {
        return v.replace(/(\w)/, '&lt;span&gt;$1&lt;/span&gt;')
      }).replaceWith(function () {
        return this.innerHTML;
      })
})
</code></pre>
