diff --git a/src/EGO MAUL Enhancement.ts b/src/EGO MAUL Enhancement.ts index 51b627e..510db0b 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/* @@ -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,8 +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 + const replaced = unescapedInnerHTML .replaceAll( /https?:\/\/(www\.)?[-a-zA-Z0-9.]{1,256}\.[a-zA-Z0-9]{2,6}\b(\/[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/g, '$&' @@ -633,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