Viewing file on branch master
| / | contrib | mumble-autolink.tengo |
| 1 | text := import("text") |
| 2 | |
| 3 | if outProtocol == "mumble" { |
| 4 | urlRE := text.re_compile(`(?is)((http|https):\/\/)?([a-z0-9-]+\.)?[a-z0-9-]+(\.[a-z]{2,6}){1,3}(\/[a-z0-9.,_\/~#&=;%+?-]*)?`) |
| 5 | msgText = urlRE.replace(msgText,`<a href="$0">$0</a>`) |
| 6 | } |
| 7 |