reuse existing function to format photo link

pull/3547/head^2
leizhe 2021-12-22 22:14:11 +08:00 committed by Tienson Qin
parent e6fa1be618
commit 59d9fac5db
1 changed files with 4 additions and 5 deletions

View File

@ -57,12 +57,11 @@
:else " ")
format (:block/format block)]
(p/let [filename (save-photo)]
(p/let [filename (save-photo)
url (util/format "../assets/%s" filename)]
(commands/simple-insert!
id
(str left-padding
(case format
:org (util/format "[[../assets/%s]]" filename)
(util/format "![%s](../assets/%s)" filename filename))
" ")
(editor-handler/get-asset-file-link format url filename true)
" ")
{}))))