From dbfd212d1ce08a4cb4cce45dbd286018b4a19a90 Mon Sep 17 00:00:00 2001 From: Dave Landry Date: Tue, 12 Feb 2019 14:49:57 -0500 Subject: [PATCH] fixes non-HTML angle brackets in text data --- src/TextBox.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TextBox.js b/src/TextBox.js index 39cbe56..a2943f1 100644 --- a/src/TextBox.js +++ b/src/TextBox.js @@ -269,13 +269,13 @@ export default class TextBox extends BaseClass { text [that._html ? "html" : "text"](t => trimRight(t) - .replace(/(<[^>^\/]+>)([^<^>]+)$/g, (str, a, b) => `${a}${b}${a.replace("<", "]+)(<\/[^>]+>)/g, (str, a, b) => `${b.replace(" `<${a}`).replace(/<$/g, "<") // replaces all non-HTML left angle brackets with escaped entity + .replace(/(<[^>^\/]+>)([^<^>]+)$/g, (str, a, b) => `${a}${b}${a.replace("<", "]+)(<\/[^>]+>)/g, (str, a, b) => `${b.replace("]*>([^<^>]+)<\/[^>]+>/g, (str, a, b) => { const tag = tagLookup[a] ? `` : ""; return `${tag.length ? tag : ""}${b}${tag.length ? "" : ""}`; - }) - ); + })); }