From 1512b8bb0bd1cba7b60378e7e806a5efa326f73b Mon Sep 17 00:00:00 2001 From: p1-ra Date: Fri, 19 Oct 2018 10:05:10 +0200 Subject: [PATCH] Disable HTML escape if configured in the options --- js/jquery.multi-select.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js index d71ca10..7089d72 100644 --- a/js/jquery.multi-select.js +++ b/js/jquery.multi-select.js @@ -108,7 +108,8 @@ attributes += attr.name+'="'+attr.value+'" '; } } - var selectableLi = $('
  • '+that.escapeHTML($option.text())+'
  • '), + + var selectableLi = (that.options.escapeHTML === false) ? $('
  • '+that.escapeHTML($option.html())+'
  • ') : $('
  • '+that.escapeHTML($option.text())+'
  • '), selectedLi = selectableLi.clone(), value = $option.val(), elementId = that.sanitize(value); @@ -199,7 +200,10 @@ }, 'escapeHTML' : function(text){ - return $("
    ").text(text).html(); + if (this.options.escapeHTML !== false) { + return $("
    ").text(text).html(); + } + return text; }, 'activeKeyboard' : function($list){