mirror of https://github.com/logseq/logseq
fix: image paste not work on production
parent
9b8a8e7da5
commit
beaa1709bb
|
@ -191,7 +191,8 @@
|
||||||
|
|
||||||
(defn path->file-ext
|
(defn path->file-ext
|
||||||
[path-or-file-name]
|
[path-or-file-name]
|
||||||
(second (re-find #"(?:\.)(\w+)[^.]*$" path-or-file-name)))
|
(let [last-part (last (string/split path-or-file-name #"/"))]
|
||||||
|
(second (re-find #"(?:\.)(\w+)[^.]*$" last-part))))
|
||||||
|
|
||||||
(defn get-format
|
(defn get-format
|
||||||
"File path to format keyword, :org, :markdown, etc."
|
"File path to format keyword, :org, :markdown, etc."
|
||||||
|
|
|
@ -396,10 +396,8 @@
|
||||||
(p/then (assets-handler/make-asset-url href) #(reset! src %)))
|
(p/then (assets-handler/make-asset-url href) #(reset! src %)))
|
||||||
|
|
||||||
(when @src
|
(when @src
|
||||||
;; NOTE(andelf): Under nfs context, src might be a bare blob:http://..../uuid URI without ext info
|
|
||||||
(let [ext (keyword (or (util/get-file-ext @src)
|
(let [ext (keyword (or (util/get-file-ext @src)
|
||||||
(util/get-file-ext href)))
|
(util/get-file-ext href)))
|
||||||
_ (prn :debug :ext ext :href href :src @src)
|
|
||||||
repo (state/get-current-repo)
|
repo (state/get-current-repo)
|
||||||
repo-dir (config/get-repo-dir repo)
|
repo-dir (config/get-repo-dir repo)
|
||||||
path (str repo-dir href)
|
path (str repo-dir href)
|
||||||
|
|
Loading…
Reference in New Issue