This commit is contained in:
blankie 2022-10-09 10:45:37 +07:00
parent fb21700517
commit 1a996e7c89
Signed by: blankie
GPG key ID: CC15FC822C7F61F5

View file

@ -36,11 +36,11 @@
(define (get-media-html url content-type)
(cond
[(eq? content-type #f) `""]
[(regexp-match? #rx"^(?i)image/" content-type)
[(regexp-match? #rx"(?i:^image/)" content-type)
`(img (@ (src ,url)))]
[(regexp-match? #rx"^(?i)audio/|^(?i)application/ogg(;|$)" content-type)
[(regexp-match? #rx"(?i:^audio/|^application/ogg(;|$))" content-type)
`(audio (@ (src ,url) (controls)))]
[(regexp-match? #rx"^(?i)video/" content-type)
[(regexp-match? #rx"(?i:^video/)" content-type)
`(video (@ (src ,url) (controls)))]
[else `""]))