From fc9c2d1f6edc43d678afb2796b1a93c55d98cf3d Mon Sep 17 00:00:00 2001 From: n1474335 Date: Wed, 1 Mar 2017 21:33:28 +0000 Subject: [PATCH] BUGFIX: HTML output which is then converted to a regular string (for a standard operation) still contained escaped HTML chars. --- src/js/core/Dish.js | 2 +- src/js/core/Utils.js | 27 +++++++++++++++++++++++++++ test/tests/operations/StrUtils.js | 24 ++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 test/tests/operations/StrUtils.js diff --git a/src/js/core/Dish.js b/src/js/core/Dish.js index e4db35bd..27fcdc06 100755 --- a/src/js/core/Dish.js +++ b/src/js/core/Dish.js @@ -139,7 +139,7 @@ Dish.prototype.translate = function(toType) { this.type = Dish.BYTE_ARRAY; break; case Dish.HTML: - this.value = this.value ? Utils.strToByteArray(Utils.stripHtmlTags(this.value, true)) : []; + this.value = this.value ? Utils.strToByteArray(Utils.unescapeHtml(Utils.stripHtmlTags(this.value, true))) : []; this.type = Dish.BYTE_ARRAY; break; default: diff --git a/src/js/core/Utils.js b/src/js/core/Utils.js index 9619f0b2..9ef0b2b1 100755 --- a/src/js/core/Utils.js +++ b/src/js/core/Utils.js @@ -928,6 +928,33 @@ var Utils = { }, + /** + * Unescapes HTML tags in a string to make them render again. + * + * @param {string} str + * @returns string + * + * @example + * // return "A