fix(pdf): support sub assets for pdf files #3024

pull/3037/head
charlie 2021-11-01 10:24:27 +08:00 committed by Tienson Qin
parent 601d14f529
commit 839b85e4df
1 changed files with 8 additions and 4 deletions

View File

@ -36,10 +36,14 @@
full-path
:else
(str "file://" ;; TODO: bfs
(util/node-path.join
(config/get-repo-dir (state/get-current-repo))
"assets" filename)))]
(let [full-path (string/replace full-path #"^[.\/\\]+" "")
full-path (if-not (string/starts-with? full-path config/local-assets-dir)
(util/node-path.join config/local-assets-dir full-path)
full-path)]
(str "file://" ;; TODO: bfs
(util/node-path.join
(config/get-repo-dir (state/get-current-repo))
full-path))))]
(when-let [key
(if web-link?
(str (hash url))