5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-24 08:41:35 +00:00
matterbridge/contrib/mumble-autolink.tengo

7 lines
244 B
Plaintext
Raw Normal View History

2023-04-03 21:00:54 +00:00
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>`)
}