Show IRIs when no display text is available
authorAlex Schroeder <alex@gnu.org>
Tue, 10 Aug 2021 17:16:33 +0000 (19:16 +0200)
committerAlex Schroeder <alex@gnu.org>
Wed, 11 Aug 2021 20:34:57 +0000 (22:34 +0200)
When using the URL in a Gemini link-line as a display-string, turn it
into an IRI.

elpher.el

index 3656189..a265a8f 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -1463,7 +1463,7 @@ Returns the url portion in the event that the display-string portion is empty."
          (idx (string-match "[ \t]" rest)))
     (string-trim (if idx
                      (substring rest (+ idx 1))
          (idx (string-match "[ \t]" rest)))
     (string-trim (if idx
                      (substring rest (+ idx 1))
-                   rest))))
+                   (elpher-address-to-iri (elpher-address-from-url (elpher-decode (url-unhex-string rest))))))))
 
 (defun elpher-collapse-dot-sequences (filename)
   "Collapse dot sequences in the (absolute) FILENAME.
 
 (defun elpher-collapse-dot-sequences (filename)
   "Collapse dot sequences in the (absolute) FILENAME.