const REGULAR_STRING = { HTML_STYLE_TAG: '<[^<>]+>', ENTER: '[\n\r]', }; Utils = { htmlDecode: function (text) { return !text ? "" : (text + "").replaceAll("&|$|{|}|"|<|>| ", function (v) { switch (v) { case "&": return "&"; case "$": return "$"; case "{": return "{"; case "}": return "}"; case """: return "\""; case "<": return "<"; case ">": return ">"; case " ": default: return " "; } }); }, getPlainText: function (name) { return Utils.htmlDecode( name.replace(new RegExp(REGULAR_STRING.HTML_STYLE_TAG, "gm"), '').replace(new RegExp(REGULAR_STRING.ENTER, "gm"), '') ) } }