Optional match on ending ;

This commit is contained in:
barry 2022-08-30 21:15:18 -04:00
parent 3194b4cd87
commit 99ea7866c5

View File

@ -30,7 +30,7 @@ function stripAllTags(html, shouldDecodeEntities = true) {
module.exports.stripAllTags = stripAllTags module.exports.stripAllTags = stripAllTags
function decodeHTMLEntities(strToDecode) { function decodeHTMLEntities(strToDecode) {
return strToDecode.replace(/\&([^;]+);/g, function (entity) { return strToDecode.replace(/\&([^;]+);?/g, function (entity) {
if (entity in entities) { if (entity in entities) {
return entities[entity] return entities[entity]
} }