enhance: display pdf by default

This commit is contained in:
Tienson Qin
2021-06-24 14:11:55 +08:00
parent da37d6a796
commit bb1540a8fa
2 changed files with 12 additions and 8 deletions

View File

@@ -1295,12 +1295,13 @@
(defn- get-asset-file-link
[format url file-name image?]
(case (keyword format)
:markdown (util/format (str (when image? "!") "[%s](%s)") file-name url)
:org (if image?
(util/format "[[%s]]" url)
(util/format "[[%s][%s]]" url file-name))
nil))
(let [pdf? (and url (string/ends-with? url ".pdf"))]
(case (keyword format)
:markdown (util/format (str (when (or image? pdf?) "!") "[%s](%s)") file-name url)
:org (if image?
(util/format "[[%s]]" url)
(util/format "[[%s][%s]]" url file-name))
nil)))
(defn- get-asset-link
[url]