From cc3d0c468e05b315f3ccc596c4c378ae061b8d2b Mon Sep 17 00:00:00 2001 From: foxster-mp4 Date: Mon, 22 May 2023 09:46:41 -0700 Subject: [PATCH] Update shared.js --- js/shared.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/shared.js b/js/shared.js index 473b75c..5f33e32 100644 --- a/js/shared.js +++ b/js/shared.js @@ -103,7 +103,7 @@ function formatString(string) { const urlArray = string.match(urlRegex); // const urlSet = [...new Set(urlArray)]; // Converting to set to remove duplicates var result = ""; - urlArray.forEach(url => { + urlArray?.forEach(url => { string = string.replace(url, `${url}`) // Remove formatted substring so it won't get formatted again (prevents tag within the href attribute another tag) let endIndexOfClosingTag = string.indexOf("") + 4; @@ -112,8 +112,10 @@ function formatString(string) { string = string.replace(formattedSubstring, ""); }); + result += string; + // New lines - return result.replaceAll("\n", "
");; + return result.replaceAll("\n", "
"); } function setTintColor(color) {