From: plugd Date: Wed, 14 Feb 2024 09:49:24 +0000 (+0100) Subject: Proper handling of query-only gemini links. X-Git-Tag: v3.5.1~1 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=22d2f81e6b829690463139a22ddd729019f23c95;p=elpher.git Proper handling of query-only gemini links. --- diff --git a/elpher.el b/elpher.el index 608f09d..4a98cb3 100644 --- a/elpher.el +++ b/elpher.el @@ -1607,12 +1607,18 @@ treatment that a separate function is warranted." (if (string-empty-p (url-filename address)) (setf (url-filename address) "/")) ;ensure empty filename is marked as absolute (setf (url-host address) (url-host current-address)) - (setf (url-fullness address) (url-host address)) ; set fullness to t if host is set - (setf (url-portspec address) (url-portspec current-address)) ; (url-port) too slow! - (unless (string-prefix-p "/" (url-filename address)) ;deal with relative links + (setf (url-fullness address) (url-host address)) ;set fullness to t if host is set + (setf (url-portspec address) (url-portspec current-address)) ;(url-port) too slow! + (cond + ((string-prefix-p "/" (url-filename address))) ;do nothing for absolute case + ((string-prefix-p "?" (url-filename address)) ;handle query-only links + (setf (url-filename address) + (concat (url-filename current-address) + (url-filename address)))) + (t ;deal with relative links (setf (url-filename address) (concat (file-name-directory (url-filename current-address)) - (url-filename address))))) + (url-filename address)))))) (when (url-host address) (setf (url-host address) (puny-encode-domain (url-host address)))) (unless (url-type address)