Mercurial Hosting > chat
comparison 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 |
comparison
equal
deleted
inserted
replaced
65:6cfef9850520 | 66:f067de76084c |
---|---|
193 document.title = title; | 193 document.title = title; |
194 ajax('active.js'); | 194 ajax('active.js'); |
195 }; | 195 }; |
196 | 196 |
197 let urlRegex = /(^|\s)(https?:\/\/\S+)/g; | 197 let urlRegex = /(^|\s)(https?:\/\/\S+)/g; |
198 let filebinUrlRegex = /(^|\s)(https:\/\/filebin.net\/[0-9a-f]+\/(\S+))/g; | |
198 | 199 |
199 function urlsToLinks(text) { | 200 function urlsToLinks(text) { |
200 return text.replace( urlRegex, '$1<a target="_blank" href="$2">$2</a>' ); | 201 text = text.replace( filebinUrlRegex, '$1<a target="_blank" href="$2">$3</a>' ); |
202 text = text.replace( urlRegex, '$1<a target="_blank" href="$2">$2</a>' ); | |
203 return text; | |
201 } | 204 } |
202 | 205 |
203 let currentPulldown = null; | 206 let currentPulldown = null; |
204 let newPulldown = null; | 207 let newPulldown = null; |
205 | 208 |