handle both (@ (src "foo")) and (@ (src ("foo")))
This commit is contained in:
parent
db64dfb68f
commit
c472cc46c1
1 changed files with 6 additions and 1 deletions
7
main.scm
7
main.scm
|
@ -151,7 +151,12 @@
|
||||||
;; (markdown->sxml "![x](x)") => ((p (img (@ (src ("x")) (alt "x")))))
|
;; (markdown->sxml "![x](x)") => ((p (img (@ (src ("x")) (alt "x")))))
|
||||||
|
|
||||||
(define (adjust-relative-src adjust-relative inner)
|
(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)))
|
(srcurl-startswith (cute string-prefix? <> srcurl)))
|
||||||
(if
|
(if
|
||||||
(or (not adjust-relative)
|
(or (not adjust-relative)
|
||||||
|
|
Loading…
Reference in a new issue