mirror of
https://codeberg.org/cage/tinmop/
synced 2025-01-19 03:00:08 +01:00
- added 'iri:iri=';
- jumping to the corresponding feature when typing in the adderss bar a special iri (e.g. 'about:bookmark').
This commit is contained in:
parent
5629c25ba6
commit
786775f106
@ -576,7 +576,11 @@
|
||||
(handler-case
|
||||
(let ((parsed-iri (iri:iri-parse iri)))
|
||||
(cond
|
||||
((gemini-parser:gemini-iri-p iri)
|
||||
((iri:iri= iri (internal-iri-bookmark))
|
||||
(funcall (menu:show-bookmarks-clsr main-window)))
|
||||
((iri:iri= iri (internal-iri-gemlogs))
|
||||
(menu:manage-gemlogs))
|
||||
((gemini-parser:gemini-iri-p iri)
|
||||
(start-stream-iri iri main-window use-cache status))
|
||||
((or (null (uri:scheme parsed-iri))
|
||||
(string= (uri:scheme parsed-iri)
|
||||
|
@ -378,3 +378,43 @@
|
||||
:port (uri:port parsed-iri)
|
||||
:path parent-path))))
|
||||
new-iri))
|
||||
|
||||
(defgeneric iri= (a b))
|
||||
|
||||
(defmethod iri= ((a iri) (b iri))
|
||||
(let ((scheme-a (uri:scheme a))
|
||||
(user-info-a (uri:user-info a))
|
||||
(host-a (uri:host a))
|
||||
(port-a (uri:port a))
|
||||
(path-a (uri:path a))
|
||||
(query-a (uri:query a))
|
||||
(fragment-a (uri:fragment a))
|
||||
(scheme-b (uri:scheme b))
|
||||
(user-info-b (uri:user-info b))
|
||||
(host-b (uri:host b))
|
||||
(port-b (uri:port b))
|
||||
(path-b (uri:path b))
|
||||
(query-b (uri:query b))
|
||||
(fragment-b (uri:fragment b)))
|
||||
(and (string= scheme-a scheme-b)
|
||||
(string= user-info-a user-info-b)
|
||||
(string= host-a host-b)
|
||||
(string= port-a port-b)
|
||||
(string= path-a path-b)
|
||||
(string= query-a query-b)
|
||||
(string= fragment-a fragment-b))))
|
||||
|
||||
(defmethod iri= ((a iri) (b string))
|
||||
(when-let ((parsed (iri-parse b :null-on-error t)))
|
||||
(iri= a parsed)))
|
||||
|
||||
(defmethod iri= ((a string) (b iri))
|
||||
(when-let ((parsed (iri-parse a :null-on-error t)))
|
||||
(iri= b parsed)))
|
||||
|
||||
(defmethod iri= ((a string) (b string))
|
||||
(let ((parsed-a (iri-parse a :null-on-error t))
|
||||
(parsed-b (iri-parse b :null-on-error t)))
|
||||
(and parsed-a
|
||||
parsed-b
|
||||
(iri= parsed-a parsed-b))))
|
||||
|
@ -756,6 +756,7 @@
|
||||
:render-iri
|
||||
:make-iri
|
||||
:iri-parse
|
||||
:iri=
|
||||
:normalize-path
|
||||
:absolute-url-p
|
||||
:ipv4-address-p
|
||||
|
Loading…
Reference in New Issue
Block a user