ivaynberg/select2 — pull request #1900 by ryanaip (2013-11-13 17:39:39+00:00)
Title: Allow formatSelection to return a DOM or jQuery element

Instead of coercing all results of `formatSelection` into a string, check to see if the function returns a string or a jQuery/DOM object. If that's the case, just insert it directly into the DOM.

This allows users to return more complicated objects, with event listeners, etc. attached.