From 717474ab9616679ccc6039d4fd7d90a336d7393a Mon Sep 17 00:00:00 2001 From: Lars Trieloff Date: Wed, 2 Dec 2020 18:22:31 +0000 Subject: [PATCH] remove ansi escape sequences from escaped output (fixes #4526) --- lib/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 853fd5b108..33d9e8c07b 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -36,7 +36,9 @@ exports.inherits = util.inherits; * @return {string} */ exports.escape = function(html) { - return he.encode(String(html), {useNamedReferences: false}); + return he + .encode(String(html), {useNamedReferences: false}) + .replace(//g, ''); }; /**