1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-01-03 01:09:20 +01:00

- added 'iri:network-path-url-p';

- [GUI] fixed opening link that points to a network path URL.
This commit is contained in:
cage 2024-12-05 14:18:31 +01:00
parent b950f6b4ee
commit 44faa2b32a
3 changed files with 9 additions and 2 deletions

View File

@ -322,7 +322,7 @@
((and (null (iri:host parsed))
(not (null (iri:scheme parsed))))
link-value)
((null (iri:scheme parsed))
((network-path-url-p link-value)
(make-gemini-iri (iri:host parsed)
(fs:normalize-path (iri:path parsed))
:scheme gemini-constants:+gemini-scheme+

View File

@ -399,13 +399,19 @@
(with-output-to-string (stream)
(render-iri object stream)))
(defun network-path-url-p (url)
(when-let ((iri (iri:iri-parse url :null-on-error t)))
(and (null (iri:scheme iri))
(iri:host iri))))
(defun relative-url-p (url)
(when-let ((iri (iri:iri-parse url :null-on-error t)))
(and (null (iri:scheme iri))
(null (iri:host iri)))))
(defun absolute-url-p (url)
(and (not (relative-url-p url))
(and (not (network-path-url-p url))
(not (relative-url-p url))
(iri:iri-parse url :null-on-error t)))
(defun absolute-url-scheme-p (url expected-scheme)

View File

@ -828,6 +828,7 @@
:iri=
:remove-fragment
:normalize-path
:network-path-url-p
:relative-url-p
:absolute-url-p
:absolute-url-scheme-p