Mercurial Hosting > chat
diff src/chat.js @ 66:f067de76084c
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 06 Mar 2025 03:09:24 -0700 |
parents | 6cfef9850520 |
children | bce0480721c1 |
line wrap: on
line diff
--- a/src/chat.js Wed Mar 05 22:30:35 2025 -0700 +++ b/src/chat.js Thu Mar 06 03:09:24 2025 -0700 @@ -195,9 +195,12 @@ }; let urlRegex = /(^|\s)(https?:\/\/\S+)/g; +let filebinUrlRegex = /(^|\s)(https:\/\/filebin.net\/[0-9a-f]+\/(\S+))/g; function urlsToLinks(text) { - return text.replace( urlRegex, '$1<a target="_blank" href="$2">$2</a>' ); + text = text.replace( filebinUrlRegex, '$1<a target="_blank" href="$2">$3</a>' ); + text = text.replace( urlRegex, '$1<a target="_blank" href="$2">$2</a>' ); + return text; } let currentPulldown = null;