From 99ea7866c581447d0f5805d32cee2d183ac055a0 Mon Sep 17 00:00:00 2001 From: barry Date: Tue, 30 Aug 2022 21:15:18 -0400 Subject: [PATCH] Optional match on ending ; --- server/utils/htmlSanitizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils/htmlSanitizer.js b/server/utils/htmlSanitizer.js index 4882052a..cdb3cfb0 100644 --- a/server/utils/htmlSanitizer.js +++ b/server/utils/htmlSanitizer.js @@ -30,7 +30,7 @@ function stripAllTags(html, shouldDecodeEntities = true) { module.exports.stripAllTags = stripAllTags function decodeHTMLEntities(strToDecode) { - return strToDecode.replace(/\&([^;]+);/g, function (entity) { + return strToDecode.replace(/\&([^;]+);?/g, function (entity) { if (entity in entities) { return entities[entity] }