From c472cc46c1afbc0a22c9da100e63a96864506323 Mon Sep 17 00:00:00 2001 From: pho4cexa Date: Wed, 1 Feb 2023 17:22:14 -0800 Subject: [PATCH] handle both (@ (src "foo")) and (@ (src ("foo"))) --- main.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.scm b/main.scm index 0e309dc..5ee3e46 100755 --- a/main.scm +++ b/main.scm @@ -151,7 +151,12 @@ ;; (markdown->sxml "![x](x)") => ((p (img (@ (src ("x")) (alt "x"))))) (define (adjust-relative-src adjust-relative inner) - (let* ((srcurl (caar (alist-ref-in '(@ src) inner equal?))) + (let* ((srcurl + (-> + ;; ugh why + (alist-ref-in '(@ src) inner equal?) + (car) + ((lambda (x) (if (list? x) (car x) x))))) (srcurl-startswith (cute string-prefix? <> srcurl))) (if (or (not adjust-relative)