commit df65b98
delthas
·
2023-11-15 18:20:31 +0000 UTC
parent 8fe2102
Parse geo: links Totally unrelated to goguma adding support for sharing one's location.
1 files changed,
+2,
-1
+2,
-1
1@@ -119,7 +119,8 @@ func (s StyledString) Truncate(w int, tail StyledString) StyledString {
2 return sb.StyledString()
3 }
4
5-var urlRegex, _ = xurls.StrictMatchingScheme(xurls.AnyScheme)
6+// https://github.com/mvdan/xurls/pull/75
7+var urlRegex, _ = xurls.StrictMatchingScheme(`([a-zA-Z][a-zA-Z.\-+]*://|(bitcoin|cid|file|geo|magnet|mailto|mid|sms|tel|xmpp):)`)
8
9 func (s StyledString) ParseURLs() StyledString {
10 if !strings.ContainsRune(s.string, '.') {