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 = $('.container'); > newObj.children().remove(); > newObj.text(); // returns orphaned text node. > > On Aug 28, 12:30 pm, Steven Black <[EMAIL PROTECTED]> wrote: > > > I develop and host wikis where users enter free-form text, and my > > server-side parsers create WISIWYG HTML from this. > > > Of course, users can, and do, submit almost anything, and on the > > server-side I do a pretty good job of marking it up properly. But > > addressing edge-cases makes the server-side parsing increasingly > > heavy. > > > One such edge case is islands of text that are not in any tag other > > than the global containing DIV. Like this: > > > <div class="container"> > > <h3>I am text within a tag</h3> > > I am a text island child of the "container" div wrapper. <--- My > > edge case > > <p>I am also text within a tag</p> > > </div> > > > QUESTION: Using jQuery, how would you select orphan text inside a DIV > > in order to $.wrap() it, say, in a "<p>" tag? > > > I'm thinking I could ask the client browsers to address some of these > > edge-cases for me. > > > Ideas? Something like $ > > (".container").textFragmentsNotInsideAnyOtherTag() > > > **--** Steve