diff --git a/select2.js b/select2.js index 4d833de5..cc550651 100755 --- a/select2.js +++ b/select2.js @@ -92,7 +92,13 @@ nextUid=(function() { var counter=1; return function() { return counter++; }; }()); - function escapeMarkup(markup) { return markup.replace("&", "&"); } + function escapeMarkup(markup) { + if (typeof(markup) === "string") { + return markup.replace("&", "&"); + } else { + return markup; + } + } function indexOf(value, array) { var i = 0, l = array.length, v;