🐛 Fixes issues with export

This commit is contained in:
alonso.torres 2021-01-28 18:06:44 +01:00
parent 41ec622e26
commit 3faa5b4a11
7 changed files with 36 additions and 24 deletions

View file

@ -257,3 +257,15 @@
(defn get-data [^js node ^string attr]
(.getAttribute node (str "data-" attr)))
(defn mtype->extension [mtype]
;; https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types
(case mtype
"image/apng" "apng"
"image/avif" "avif"
"image/gif" "gif"
"image/jpeg" "jpg"
"image/png" "png"
"image/svg+xml" "svg"
"image/webp" "webp"
nil))