mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-18 08:20:35 +01:00
- specialize 'normalize-path' on iri;
- changed package name: uri-parser -> uri.
This commit is contained in:
parent
62394d319a
commit
c0abc807d1
@ -213,9 +213,9 @@
|
|||||||
|
|
||||||
(defrule iri-reference (or iri irelative-ref))
|
(defrule iri-reference (or iri irelative-ref))
|
||||||
|
|
||||||
(defclass iri (uri-parser:uri) ())
|
(defclass iri (uri:uri) ())
|
||||||
|
|
||||||
(defmethod uri-parser:host ((object iri))
|
(defmethod uri:host ((object iri))
|
||||||
(let ((host (slot-value object 'host)))
|
(let ((host (slot-value object 'host)))
|
||||||
(if (text-utils:string-starts-with-p "[" host)
|
(if (text-utils:string-starts-with-p "[" host)
|
||||||
(subseq host 1 (1- (length host)))
|
(subseq host 1 (1- (length host)))
|
||||||
@ -265,6 +265,13 @@
|
|||||||
query
|
query
|
||||||
fragment)))
|
fragment)))
|
||||||
|
|
||||||
|
(defmethod uri:normalize-path ((object iri))
|
||||||
|
(let ((clean-path (uri:normalize-path (uri:path object)))
|
||||||
|
(copy (copy-iri object)))
|
||||||
|
(when clean-path
|
||||||
|
(setf (uri:path copy) clean-path))
|
||||||
|
copy))
|
||||||
|
|
||||||
(defun render-iri (iri &optional (stream *standard-output*))
|
(defun render-iri (iri &optional (stream *standard-output*))
|
||||||
(flet ((render ()
|
(flet ((render ()
|
||||||
(with-output-to-string (string-stream)
|
(with-output-to-string (string-stream)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user