[jQuery] Wrap tagless text fragments?
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
One such edge case is islands of text that are not in any tag other
than the global containing DIV. Like this:
<h3>I am text within a tag</h3>
I am a text island child of the "container" div wrapper. <--- My
I am also text within a tag
QUESTION: Using jQuery, how would you select orphan text inside a DIV
in order to $.wrap() it, say, in a "
I'm thinking I could ask the client browsers to address some of these
edge-cases for me.
Ideas? Something like $