From 1e9ebfb3aec50a18bfaec8da2a96b9604e40ca18 Mon Sep 17 00:00:00 2001 From: Julien Blanchard Date: Fri, 18 Dec 2020 11:20:33 +0000 Subject: [PATCH] Fix absolute URLs parsing and mailto --- castor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/castor.c b/castor.c index d9fae91..3eacf84 100644 --- a/castor.c +++ b/castor.c @@ -606,6 +606,8 @@ texthit(Panel *p, int b, Rtext *rt) next_url = urlparse(nil, link); }else if(strbeg(link, "//") == 0){ next_url = urlparse(nil, smprint("gemini:%s", link)); + }else if(strbeg(link, "mailto:") == 0){ + next_url = urlparse(nil, link); }else{ /* assuming relative URL */ if(strcmp(link, "/") == 0){ @@ -613,7 +615,7 @@ texthit(Panel *p, int b, Rtext *rt) }else if(*link == '/'){ n = smprint("%s%s", urlparse(current_base_url, link)->raw, estrdup(link)+1); }else{ - n = estrdup(link); + n = smprint("%s%s", urlparse(current_base_url, link)->raw, estrdup(link)); } next_url = urlparse(nil, n); } -- 2.45.2