summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/style.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/style.go b/ui/style.go
index 91cd2e1..4552020 100644
--- a/ui/style.go
+++ b/ui/style.go
@@ -120,6 +120,11 @@ func (s StyledString) Truncate(w int, tail StyledString) StyledString {
var urlRegex = xurls.Relaxed()
func (s StyledString) ParseURLs() StyledString {
+ if !strings.ContainsRune(s.string, '.') {
+ // fast path: no dot means no URL
+ return s
+ }
+
styles := make([]rangedStyle, 0, len(s.styles))
urls := urlRegex.FindAllStringIndex(s.string, -1)