Mercurial Hosting > chat
comparison src/chat.js @ 121:b96d598aa7d1 default tip
minor
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Fri, 05 Dec 2025 11:29:31 -0700 |
| parents | d7e143175d9f |
| children |
comparison
equal
deleted
inserted
replaced
| 120:d7e143175d9f | 121:b96d598aa7d1 |
|---|---|
| 251 active(); | 251 active(); |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 let converter = window.markdownit({linkify:true}); | 254 let converter = window.markdownit({linkify:true}); |
| 255 let filebinUrlRegex = />https:\/\/filebin.net\/[0-9a-f]+\/([^<]+)</g; | 255 let filebinUrlRegex = />https:\/\/filebin.net\/[0-9a-f]+\/([^<]+)</g; |
| 256 let urlRegex = /(<a href="https?:\/\/[^" ]+")>/g; | |
| 256 | 257 |
| 257 function handleMarkdown(text) { | 258 function handleMarkdown(text) { |
| 258 text = converter.renderInline(text); | 259 text = converter.renderInline(text); |
| 259 text = text.replace( filebinUrlRegex, '>$1<' ); | 260 text = text.replace( filebinUrlRegex, '>$1<' ); |
| 261 text = text.replace( urlRegex, '$1 target="_blank">' ); | |
| 260 return text; | 262 return text; |
| 261 } | 263 } |
| 262 | 264 |
| 263 let currentPulldown = null; | 265 let currentPulldown = null; |
| 264 let newPulldown = null; | 266 let newPulldown = null; |
