From d385dc512eaaba9be4b4a679316515040401fe6b Mon Sep 17 00:00:00 2001 From: Dylan Roux Date: Fri, 26 Sep 2014 15:14:19 +0200 Subject: [PATCH] allow formatSelection to return a jQuery object --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index faeac47a..211c5ed4 100644 --- a/select2.js +++ b/select2.js @@ -3052,7 +3052,7 @@ the specific language governing permissions and limitations under the Apache Lic formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup); if (formatted != undefined) { - choice.find("div").replaceWith("
"+formatted+"
"); + choice.find("div").replaceWith($("
").html(formatted)); } cssClass=this.opts.formatSelectionCssClass(data, choice.find("div")); if (cssClass != undefined) {