From d97a6e3123713cace679308e5e2c7bdccf43a864 Mon Sep 17 00:00:00 2001 From: blankdvth Date: Wed, 15 Mar 2023 12:30:45 -0400 Subject: [PATCH 1/3] Fix & appearing as & --- src/EGO MAUL Enhancement.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EGO MAUL Enhancement.ts b/src/EGO MAUL Enhancement.ts index 51b627e..e6d99a5 100644 --- a/src/EGO MAUL Enhancement.ts +++ b/src/EGO MAUL Enhancement.ts @@ -624,6 +624,7 @@ function updateBanNoteURLs() { banNotes.forEach((banNote) => { // Replace the text with a linkified version const replaced = banNote.innerHTML + .replace(/&/g, "&") // Replace & with & .replaceAll( /https?:\/\/(www\.)?[-a-zA-Z0-9.]{1,256}\.[a-zA-Z0-9]{2,6}\b(\/[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/g, '$&' From 4419a286116a1419adc116fae214a1677731d0bc Mon Sep 17 00:00:00 2001 From: blankdvth Date: Wed, 15 Mar 2023 12:31:27 -0400 Subject: [PATCH 2/3] Bump build number --- src/EGO MAUL Enhancement.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EGO MAUL Enhancement.ts b/src/EGO MAUL Enhancement.ts index e6d99a5..fd14402 100644 --- a/src/EGO MAUL Enhancement.ts +++ b/src/EGO MAUL Enhancement.ts @@ -3,7 +3,7 @@ // @namespace https://github.com/blankdvth/eGOScripts/blob/master/src/EGO%20MAUL%20Enhancement.ts // @downloadURL %DOWNLOAD_URL% // @updateURL %DOWNLOAD_URL% -// @version 4.3.0 +// @version 4.3.1 // @description Add various enhancements & QOL additions to the EdgeGamers MAUL page that are beneficial for CS Leadership members. // @author blank_dvth, Left, Skle, MSWS // @match https://maul.edgegamers.com/* From bda948532e9932980637b74aabcc93986343946a Mon Sep 17 00:00:00 2001 From: blankdvth Date: Wed, 15 Mar 2023 12:36:10 -0400 Subject: [PATCH 3/3] Fix change detection, add to usernote hyperlinking --- src/EGO MAUL Enhancement.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/EGO MAUL Enhancement.ts b/src/EGO MAUL Enhancement.ts index fd14402..510db0b 100644 --- a/src/EGO MAUL Enhancement.ts +++ b/src/EGO MAUL Enhancement.ts @@ -515,6 +515,7 @@ function handleProfile() { // Empty or possible HTML injection return; userNote.innerHTML = userNote.textContent + .replaceAll(/&/g, "&") // Replace & with & .replaceAll( /(?:https?:\/\/)?(?:www\.)?edge-gamers\.com\/forums\/showthread\.php\?p=(\d+)(?:#?post(\d+))?/g, function (match, threadId, postId) { @@ -622,9 +623,9 @@ function convertGameIDs() { function updateBanNoteURLs() { const banNotes = document.querySelectorAll("span[id*=notes].col-xs-10"); banNotes.forEach((banNote) => { + const unescapedInnerHTML = banNote.innerHTML.replaceAll(/&/g, "&"); // Replace & with & // Replace the text with a linkified version - const replaced = banNote.innerHTML - .replace(/&/g, "&") // Replace & with & + const replaced = unescapedInnerHTML .replaceAll( /https?:\/\/(www\.)?[-a-zA-Z0-9.]{1,256}\.[a-zA-Z0-9]{2,6}\b(\/[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/g, '$&' @@ -634,7 +635,7 @@ function updateBanNoteURLs() { '$1$2$3' ); // If the text hasn't been changed, move on - if (replaced === banNote.innerHTML) return; + if (replaced === unescapedInnerHTML) return; // Store the original text as a data attribute (banNote as HTMLSpanElement).dataset.original = banNote.innerHTML; // Replace the text with a linkified version