summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/mumble-autolink.tengo6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/mumble-autolink.tengo b/contrib/mumble-autolink.tengo
new file mode 100644
index 00000000..527ff6f1
--- /dev/null
+++ b/contrib/mumble-autolink.tengo
@@ -0,0 +1,6 @@
+text := import("text")
+
+if outProtocol == "mumble" {
+ urlRE := text.re_compile(`(?is)((http|https):\/\/)?([a-z0-9-]+\.)?[a-z0-9-]+(\.[a-z]{2,6}){1,3}(\/[a-z0-9.,_\/~#&=;%+?-]*)?`)
+ msgText = urlRE.replace(msgText,`<a href="$0">$0</a>`)
+}