Open BlacKcuD opened 2 years ago
Looks like its matching reURLWithScheme/reURL in the helpers file.
const reURL = /(http(s)?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g;
const reMail = /^\S+@\S+$/;
const reURLWithScheme = /^([a-z]+:)?\/\//i;
export function formatDescription(s: string) {
s = s.trim().replace(/\n/g, '<br>');
s = s.replace(reURL, (substring) => {
let href = substring;
if (href.match(reMail)) {
href = `mailto:${href}`;
}
else if (!href.match(reURLWithScheme)) {
href = `http://${href}`;
}
return `<a href="${href}" target="_blank">${substring}</a>`;
});
return s;
}
In the patch notes section of an arcade map overview, e.g. https://sc2arcade.com/map/2/184805/ text of the form
someword..someword
will be erroneously recognised as a clickable URL.