diff options
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 2eeaea9b9..9d48582bb 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -30,6 +30,7 @@ $.widget("ui.selectmenu", { maxHeight: null, icons: null, format: null, + escapeHtml: false, bgImage: function() {}, wrapperElement: "<div />" }, @@ -624,9 +625,14 @@ $.widget("ui.selectmenu", { this.open(event); } }, - + _formatText: function(text) { - return (this.options.format ? this.options.format(text) : text); + if (this.options.format) { + text = this.options.format(text); + } else if (this.options.escapeHtml) { + text = $('<div />').text(text).html(); + } + return text; }, _selectedIndex: function() { |