Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/EGO MAUL Enhancement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
'<a href="$&" target="_blank" rel="external">$&</a>'
Expand All @@ -633,7 +635,7 @@ function updateBanNoteURLs() {
'$1<a href="https://maul.edgegamers.com/index.php?page=bans&qType=gameId&q=$2" target="_blank">$2</a>$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
Expand Down