From 3d20833d42f0bc011ff49e92d6a8dc6f276b53c5 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Fri, 8 Feb 2019 17:28:10 +0000 Subject: [PATCH] Fixed populateOption HTML escape bug. Closes #490 --- src/core/operations/RegularExpression.mjs | 2 +- src/web/HTMLIngredient.mjs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/operations/RegularExpression.mjs b/src/core/operations/RegularExpression.mjs index cce65c63..d8411683 100644 --- a/src/core/operations/RegularExpression.mjs +++ b/src/core/operations/RegularExpression.mjs @@ -240,7 +240,7 @@ function regexHighlight (input, regex, displayTotal) { if (groups.length) { title += "Groups:\n"; for (let i = 0; i < groups.length; i++) { - title += `\t${i+1}: ${Utils.escapeHtml(groups[i])}\n`; + title += `\t${i+1}: ${Utils.escapeHtml(groups[i] || "")}\n`; } } diff --git a/src/web/HTMLIngredient.mjs b/src/web/HTMLIngredient.mjs index 59b7bec7..ab7f682b 100755 --- a/src/web/HTMLIngredient.mjs +++ b/src/web/HTMLIngredient.mjs @@ -4,6 +4,8 @@ * @license Apache-2.0 */ +import Utils from "../core/Utils"; + /** * Object to handle the creation of operation ingredients. */ @@ -156,7 +158,7 @@ class HTMLIngredient { } else if ((m = this.value[i].name.match(/\[\/([a-z0-9 -()^]+)\]/i))) { html += ""; } else { - html += ``; + html += ``; } } html += `