Unfortunately, it is not a jquery issue. I've experienced the bug and implemented a workaround, but after a while it seemed to be gone even in my "broken" version. I've searched the web and found that the bug (Firefox not supporting .innerHTML) was present in Firefox 1.5 and below - but is supposed to be fixed in any later versions.
It seems more likely that I've triggered a rare regression in Firefox than a bug in jquery. While .innerHTML is still non-standard, it seems to be present almost everywhere, so I guess avoiding it is a non-issue.
This seems to be the real problem: I have been using markItUp, which has an extra quote in the code (it's just a single quote character that should not be there). See
for details. This extra quote causes .wrap() to be called with invalid markup.
Firefox 3 handles .innerHTML in XHTML just fine, but only with valid markup in the innerHTML. The extra quote causes something like <code><div "></code> to be set as the innerHTML which THEN causes the exception.
The bug is obviously a Firefox issue (since they decided to support innerHTML), and I may file a bug report at their tracker as well.