handle both (@ (src "foo")) and (@ (src ("foo")))

This commit is contained in:
pho4cexa 2023-02-01 17:22:14 -08:00
parent db64dfb68f
commit c472cc46c1

View file

@ -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)