cdechoch commited on
Commit
f91da9c
·
verified ·
1 Parent(s): 6936546

Update team.html

Browse files
Files changed (1) hide show
  1. team.html +3 -5
team.html CHANGED
@@ -119,12 +119,10 @@
119
  function processText(text) {
120
  if (!text) return '';
121
  let escaped = escapeHtml(text);
122
- // Match URLs - https://, http://, and common short domains
123
  escaped = escaped.replace(/(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/gi, '<a href="$1" target="_blank">$1</a>');
124
- // Match youtu.be, bit.ly, etc without protocol
125
- escaped = escaped.replace(/(?<![\/\w])((?:youtu\.be|bit\.ly|t\.co|tinyurl\.com|goo\.gl)\/[^\s<]+[^<.,:;"')\]\s])/gi, '<a href="https://$1" target="_blank">$1</a>');
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>`);