diff --git a/select2.js b/select2.js index 13bbd12b..9ffc0282 100644 --- a/select2.js +++ b/select2.js @@ -2450,16 +2450,15 @@ the specific language governing permissions and limitations under the Apache Lic escapeMarkup: function (markup) { var replace_map = { '\\': '\', - '&': '&#amp;', - '<': '&#lt;', - '>': '&#rt;', - '"': '&#quot;', - "'": ''', - "/": '/' + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + "/": '/' }; - //'--': '--' - return String(html).replace(/[&<>"'/\\]/g, function (match) { + return String(markup).replace(/[&<>"'/\\]/g, function (match) { return replace_map[match[0]]; });