garyharan/jQuery-caret-utilities — pull request #3 by lipanski (2013-10-17 21:59:45+00:00)
Title: Added support for content-editable containers (divs).

I recently needed to use this on a contenteditable div. I realised divs don't respond to `document.selection` but only to `document.getSelection()`, so that's how I implemented it.

The **insertion** occures either at *caret position* or if a *single pair of nodes* are selected (multiple node selection is currently ignored because frankly I didn't need it + it comes with some nasty DOM changes).

Anyway, hope it helps someone.