From 099e74cc387d4374f6024a5c78631ee6b41ffc11 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Sun, 18 Feb 2024 21:46:55 -0600 Subject: [PATCH] =?UTF-8?q?Fix=20mistakenly=20adding=20=E2=80=9C./?= =?UTF-8?q?=E2=80=9D=20when=20uri->string=E2=80=99ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is due to weird/mistakenly input URLs… like Matrix ones, which uri-common doesn’t like. ¯\_(ツ)_/¯ --- vcarded.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vcarded.scm b/vcarded.scm index 285cd45..f9769c3 100644 --- a/vcarded.scm +++ b/vcarded.scm @@ -69,6 +69,7 @@ (uri:uri-reference string)) + ;; Parse a data URI’s contents into a list containing the mimetype (string) ;; and bytevector contents (u8vector). ;; "data:text/plain;base64,ZGFk" → ("text/plain;base64" #u8(100 97 100)) @@ -123,7 +124,10 @@ ;; string-form… as best we can. (define (serialize-uri-prop-value value) (cond [(uri:uri? value) - (uri:uri->string value)] + (irregex-replace + ":./" + (uri:uri->string value) + ":")] ;; Some URIs have “./” mistakenly prepended. [(list? value) (bytevector->data-uri-str (car value) (cadr value))] [(string? value)