gem.awk

A gemini client in POSIX awk
git clone git://git.vgx.fr/gem.awk
Log | Files | Refs

commit 1d6a6526ffd8e69b29b1c2f7c6e5a68e3fdaaa90
parent 1ecd5318d418a51dd464386233450173cff749cd
Author: Léo Villeveygoux <l@vgx.fr>
Date:   Thu,  4 Jun 2020 05:53:56 +0200

Support local absolute URL

Diffstat:
Mgem.awk | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gem.awk b/gem.awk @@ -128,7 +128,11 @@ function gemini_url_open(url) { function any_url_open(url, base_url) { if (!base_url) base_url = PAGE_URL - if (url ~ /^[^:]+(\/.*)?$/) { + if (url ~ /^\//) { + # local absolute link + match(PAGE_URL, /^gemini:\/\/[^\/]+/) + gemini_url_open(substr(PAGE_URL, 1, RLENGTH) url) + } else if (url ~ /^[^:]+(\/.*)?$/) { # relative link if (base_url ~ /\/$/) gemini_url_open(base_url url)