Auto add trailing for directoryless URLs

These usually redirect anyway, and Dillo doesn't handle the redirect
very well.
This commit is contained in:
cel 2020-05-30 20:44:37 -04:00
parent c2415c4fd0
commit ff51ee728c
1 changed files with 3 additions and 0 deletions

View File

@ -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