summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-12-31 18:48:27 +0200
committerPaul Buetow <paul@buetow.org>2024-12-31 18:48:27 +0200
commit8479058ac8f362ae646dc7f1a29eaff7308b1005 (patch)
tree06c3d0f5035cf3857afb843626dea8a825df1338
parent5d867735f5daa0387146732f21ba8c31232e04ed (diff)
better
-rw-r--r--internal/summary/summary.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/summary/summary.go b/internal/summary/summary.go
index 158ef3d..cc9fe93 100644
--- a/internal/summary/summary.go
+++ b/internal/summary/summary.go
@@ -154,8 +154,8 @@ func gemtextLink(url string, maxLen int) string {
url = strings.TrimSpace(url)
urlNoProto := regexp.MustCompile(`^[a-zA-Z]+://`).ReplaceAllString(url, "")
- if len(url) <= maxLen {
- return "=> " + url
+ if len(urlNoProto) <= maxLen {
+ return "=> " + url + " " + urlNoProto
}
halfLen := (maxLen - 3) / 2
shorten := urlNoProto[:halfLen] + "..." + urlNoProto[len(urlNoProto)-halfLen:]