jquery find text nodes within an element and join and wrap with a tag
<p>I'm a newbie and am having a hard time with some text that has no element, I am trying to wrap text outside of a tag with a list tag :</p>

<p><a href="http://jsfiddle.net/danb/7xu6A/" rel="nofollow">http://jsfiddle.net/danb/7xu6A/</a></p>

<p><strong>HTML</strong></p>

<pre><code>&lt;ul&gt;
    &lt;li&gt;&lt;a href="#"&gt;item1&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;item2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;item3&lt;/a&gt;&lt;/li&gt;
    text &lt;br&gt;to wrap and combine        
    &lt;li&gt;&lt;a href="#"&gt;item4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>This was working for me until I came across some instances where the string was broken with a <br> tag - even if i take out the <code>&lt;br&gt;</code> first they are still separate nodes and get wrapped as such.</p>

<pre><code>$('ul').contents().remove('br')
       .filter(function()
       {
           return (this.nodeType === 3 &amp;&amp; $.trim(this.data) !== '');
       }).wrap('&lt;li class="nav current"&gt;&lt;/li&gt;');
</code></pre>

<p>any help is greatly appreciated</p>
