From 0c5c599150cd64f7eea98417b903f3fa2a3297a5 Mon Sep 17 00:00:00 2001 From: Michael Rowley Date: Thu, 30 Dec 2021 23:27:09 +0000 Subject: [PATCH] Fixed errors --- src/core/operations/HTMLToText.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/operations/HTMLToText.mjs b/src/core/operations/HTMLToText.mjs index 7e42f5c7..17b19838 100644 --- a/src/core/operations/HTMLToText.mjs +++ b/src/core/operations/HTMLToText.mjs @@ -36,14 +36,14 @@ class HTMLToText extends Operation { // TODO: Add blacklisted tags via args. // TODO: Extract from HTML comments. let output = ""; - const blacklistedTags = [ "script", "style" ]; - const tagRegex = /<\w+>[\s?!\-_().,\/#{}*"£$%^&;:a-z]*/gis; + const blacklistedTags = ["script", "style"]; + const tagRegex = /<\w+>[\s?!\-_().,/#{}*"£$%^&;:a-z]*/gis; const tagMatches = input.match(tagRegex); tagMatches.forEach((iterativeMatch) => { - const closingTagOffset = iterativeMatch.indexOf('>'); + const closingTagOffset = iterativeMatch.indexOf(">"); const tag = iterativeMatch.substring(1, closingTagOffset); for (let i = 0; i < blacklistedTags.length; i++) { - if (tag == blacklistedTags[i]) { + if (tag === blacklistedTags[i]) { return; // This is why a forEach(...) loop couldn't be used for this nested one. } }