aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-05-30 20:44:37 -0400
committercel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-05-30 20:44:37 -0400
commitff51ee728c69bc233744039822b3e92db721b4c9 (patch)
treea8548e4daad2302efde83a799a776328cae8c5f5
parentc2415c4fd01f8bfdfbde6b2912f6832891cee46e (diff)
Auto add trailing for directoryless URLs
These usually redirect anyway, and Dillo doesn't handle the redirect very well.
-rwxr-xr-xgemini.filter.dpi3
1 files changed, 3 insertions, 0 deletions
diff --git a/gemini.filter.dpi b/gemini.filter.dpi
index b89abd8..b2c52b5 100755
--- a/gemini.filter.dpi
+++ b/gemini.filter.dpi
@@ -94,6 +94,9 @@ render_gemini() {
if (!text) {
text = href
}
+ if (match(href, /^gemini:\/\/[^/]+$/)) {
+ href = href "/"
+ }
sub(/^\t+/, "", prefix)
html = escape_html(text)
printf "<div>%s<a href=\"%s\">%s</a></div>\n", prefix, href, html