Update team.html
Browse files
team.html
CHANGED
|
@@ -119,12 +119,10 @@
|
|
| 119 |
function processText(text) {
|
| 120 |
if (!text) return '';
|
| 121 |
let escaped = escapeHtml(text);
|
| 122 |
-
// Match URLs
|
| 123 |
escaped = escaped.replace(/(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/gi, '<a href="$1" target="_blank">$1</a>');
|
| 124 |
-
// Match
|
| 125 |
-
escaped = escaped.replace(/(?<![\/\w])((?:
|
| 126 |
-
// Match www. URLs
|
| 127 |
-
escaped = escaped.replace(/(?<![\/\w])(www\.[^\s<]+[^<.,:;"')\]\s])/gi, '<a href="https://$1" target="_blank">$1</a>');
|
| 128 |
for (const player of allPlayers) {
|
| 129 |
const regex = new RegExp(`\\b(${player.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})\\b`, 'gi');
|
| 130 |
escaped = escaped.replace(regex, `<a href="/player/${encodeURIComponent(player)}" class="player-link">$1</a>`);
|
|
|
|
| 119 |
function processText(text) {
|
| 120 |
if (!text) return '';
|
| 121 |
let escaped = escapeHtml(text);
|
| 122 |
+
// Match URLs with https:// or http://
|
| 123 |
escaped = escaped.replace(/(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/gi, '<a href="$1" target="_blank">$1</a>');
|
| 124 |
+
// Match domain.com/path URLs (common patterns without protocol)
|
| 125 |
+
escaped = escaped.replace(/(?<![\/\w@])((?:[a-zA-Z0-9-]+\.)+(?:com|net|org|io|co|tv|be|ly|me|us|uk|ca|au|de|fr|es|it|nl|app|dev|gg|xyz|info|biz)\/[^\s<]*[^<.,:;"')\]\s])/gi, '<a href="https://$1" target="_blank">$1</a>');
|
|
|
|
|
|
|
| 126 |
for (const player of allPlayers) {
|
| 127 |
const regex = new RegExp(`\\b(${player.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})\\b`, 'gi');
|
| 128 |
escaped = escaped.replace(regex, `<a href="/player/${encodeURIComponent(player)}" class="player-link">$1</a>`);
|