From 98d0dbc6d8cea8d5b994b5110501cacd8e62211a Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Wed, 28 Dec 2011 18:56:41 +0100 Subject: [PATCH] added: feature for html escaping, see #131 --- ui/jquery.ui.selectmenu.js | 10 ++++++++-- 1 file 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: "
" }, @@ -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 = $('
').text(text).html(); + } + return text; }, _selectedIndex: function() { -- 2.39.5