A local copy of the jquery.wrapSelection plugin, which was not authored by me, but looks like it is abandoned.