Thanks, seems to have moved on but still having problems. The wrap started working, but we then get other problems (like destroying markers afterwards - previously destroyed all </fullwordmatch> but obviously can't do that with </div>). It looks like the IE8 scripting engine messes about with the DOM in ways in which it wasn't asked to. I'm going to investigate more.
–
AnonymousJul 24 '09 at 14:56

I ran into the same issue myself. The cause in my scenario was that I was adding an input element but assigned a .text() to the input tag. When appending the input tag, it failed generating the same error as you have encountered.