diff options
| author | Paul Buetow <paul@buetow.org> | 2024-12-31 18:48:27 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-12-31 18:48:27 +0200 |
| commit | 8479058ac8f362ae646dc7f1a29eaff7308b1005 (patch) | |
| tree | 06c3d0f5035cf3857afb843626dea8a825df1338 | |
| parent | 5d867735f5daa0387146732f21ba8c31232e04ed (diff) | |
better
| -rw-r--r-- | internal/summary/summary.go | 4 |
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:] |
