Just when I thought I was done, I found in between my selected pagination '5' for example below, double hard coded non-breaking spaces
. I don't have access in the cms to override this, so jquery is required.
What is the solution to be sure the pagination gets selected, not the
. Please check out the fiddle so you can demo the exact experience.
fiddle http://jsfiddle.net/evanmoore/9AMnU/2/
HTML
<a href="http://www.example.com">4</a>
5
<a href="http://www.example.com">6</a>
This jquery cleans up and span tags around the pagination
$('.pag').each(function () {
$(this).contents().filter(function () {
return this.nodeType === 3 && $.trim(this.textContent) !== ''
}).first().wrap('<div/>').parent().html(function (i, v) {
return v.replace(/(\w)/, '<span>$1</span>')
}).replaceWith(function () {
return this.innerHTML;
})
})