aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Picciano <me@mediocregopher.com>2024-11-01 13:16:24 +0100
committerBrian Picciano <me@mediocregopher.com>2024-11-01 13:16:24 +0100
commit76d8b138ce23687c6372b34ee71e52f2b057469f (patch)
tree607313f38b8f292fbaad10d5c4ac57d28028bb72
parent52f288c3ad444b4b6f0267364bf9cce08e334d92 (diff)
Fix 'proxied' being added to all labels by gemtext_function
-rw-r--r--http/handlers/templates/functions/gemtext.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/http/handlers/templates/functions/gemtext.go b/http/handlers/templates/functions/gemtext.go
index bc7a31f..45ded45 100644
--- a/http/handlers/templates/functions/gemtext.go
+++ b/http/handlers/templates/functions/gemtext.go
@@ -75,10 +75,11 @@ func (g *Gemtext) funcGemtext(input any) (gemtext.HTML, error) {
translator.RenderLink = func(w io.Writer, urlStr, label string) error {
if u, err := url.Parse(urlStr); err == nil && u.Scheme == "gemini" {
urlStr = g.GatewayURL + u.Host + u.Path
+ label += " (proxied)"
}
_, err := fmt.Fprintf(
- w, "<p><a href=\"%s\">%s (proxied)</a></p>\n", urlStr, label,
+ w, "<p><a href=\"%s\">%s</a></p>\n", urlStr, label,
)
return err
}