[jQuery] Re: Wrap tagless text fragments?

2008-08-28 Thread [EMAIL PROTECTED]
This thread mentions a plugin that you might find useful. Perhaps it could be adapted to what you need: http://groups.google.com/group/jquery-en/browse_thread/thread/c16b9095538c3344 On Aug 28, 12:30 pm, Steven Black [EMAIL PROTECTED] wrote: I develop and host wikis where users enter

[jQuery] Re: Wrap tagless text fragments?

2008-08-28 Thread [EMAIL PROTECTED]
Also found this technique, which does a decent job of returning orphaned text, and could probably be adapted to your needs: newObj = $('.container'); newObj.children().remove(); newObj.text(); // returns orphaned text node. On Aug 28, 12:30 pm, Steven Black [EMAIL PROTECTED] wrote: I develop

[jQuery] Re: Wrap tagless text fragments?

2008-08-28 Thread Danny
A quick plugin that I think will work for you: $.fn.orphans = function(){ var ret = []; this.each(function(){$.each(this.childNodes, function() {if (this.nodeType == 3) ret.push(this)})}); return $(ret); } You may want to test for

[jQuery] Re: Wrap tagless text fragments?

2008-08-28 Thread Steven Black
@Danny, that's absolutely brilliant! I am very impressed with that elegant solution. You've done me a kindness, and I appreciate that very much. **--** Steve On Aug 28, 11:02 pm, Danny [EMAIL PROTECTED] wrote: A quick plugin that I think will work for you:         $.fn.orphans =

[jQuery] Re: Wrap tagless text fragments?

2008-08-28 Thread Steven Black
Thanks Nick! Those are great directions and I like those approaches. **--** Steve On Aug 28, 6:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Also found this technique, which does a decent job of returning orphaned text, and could probably be adapted to your needs: newObj =