fix(pdf): open pdf file

This commit is contained in:
charlie
2025-04-10 18:13:33 +08:00
parent f3c42fa972
commit 4f26956ce7

View File

@@ -43,11 +43,12 @@
[original-path & {:keys [href block]}]
(let [web-link? (string/starts-with? original-path "http")
blob-res? (some-> href (string/starts-with? "blob"))
asset-res? (some-> href (string/starts-with? "assets"))
filename (util/node-path.basename original-path)
ext-name "pdf"
url (if blob-res? href
(assets-handler/normalize-asset-resource-url original-path))
filename' (if (or web-link? blob-res?) filename
filename' (if (or asset-res? web-link? blob-res?) filename
(some-> (get-in-repo-assets-full-filename url)
(js/decodeURIComponent) (string/replace '"/" "_")))
filekey (util/safe-sanitize-file-name