diff --git a/layouts/v7/modules/Emails/resources/MassEdit.js b/layouts/v7/modules/Emails/resources/MassEdit.js index 05dc98d191fd5d23cd9bcba0ed9bbcf314d2c98b..830481f6ddb567d1d789f6ecb93a2c9efa6eb95d 100644 --- a/layouts/v7/modules/Emails/resources/MassEdit.js +++ b/layouts/v7/modules/Emails/resources/MassEdit.js @@ -281,6 +281,11 @@ jQuery.Class("Emails_MassEdit_Js",{},{ return { id: term, text: term }; } }, + escapeMarkup: function(m) { + // Do not escape HTML in the select options text + m = vtUtils.stripTags(String(m),'<i><b>'); + return m; + } }).on("change", function (selectedData) { var addedElement = selectedData.added; diff --git a/layouts/v7/modules/Vtiger/resources/Utils.js b/layouts/v7/modules/Vtiger/resources/Utils.js index 455e205cd91d419dc756de58e1f148c87db0ca92..c51009b48d412c9d050e8d58079915bbaa794d2e 100644 --- a/layouts/v7/modules/Vtiger/resources/Utils.js +++ b/layouts/v7/modules/Vtiger/resources/Utils.js @@ -366,6 +366,14 @@ var vtUtils = { jQuery(function () { jQuery('[data-toggle="tooltip"]').tooltip(options); }); + }, + + stripTags : function(string,allowed) { + //https://stackoverflow.com/questions/5601903/jquery-almost-equivalent-of-phps-strip-tags#answer-46483672 + allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); + var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi; + return string.replace(tags, function ($0, $1) { + return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; + }); } - }