summaryrefslogtreecommitdiff
path: root/markdown.scm
diff options
context:
space:
mode:
Diffstat (limited to 'markdown.scm')
-rw-r--r--markdown.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/markdown.scm b/markdown.scm
index d1a70b4..1fcf721 100644
--- a/markdown.scm
+++ b/markdown.scm
@@ -29,10 +29,13 @@
;; <img> tags with a ".webm" source and substitute a <video> tag.
(define (media-hackery . tree)
(sxml-match tree
- ((img (@ (src ,src) . ,attrs) . ,body)
- (if (string-suffix? ".webm" src)
- `(video (@ (src ,src) (controls "true"),@attrs) ,@body)
- tree))))
+ ((img (@ (src ,src) (alt ,alt) . ,attrs) . ,body)
+ (cond
+ ((string=? src "sxml")
+ (call-with-input-string alt read))
+ ((string-suffix? ".webm" src)
+ `(video (@ (src ,src) (controls "true") ,@attrs) ,@body))
+ (else tree)))))
(define %commonmark-rules
`((code . ,highlight-code)