mirror of https://github.com/logseq/logseq
fix redundant relative path when inserting orgmode page reference
occurs when creating a new page in autocomplete menu if `org-mode/insert-file-link` non-nils. fix https://github.com/logseq/logseq/issues/4732pull/4802/head
parent
93b49b59d5
commit
a1293513ec
|
@ -577,10 +577,17 @@
|
|||
(util/get-relative-path edit-block-file-path ref-file-path)
|
||||
page)
|
||||
(let [journal? (date/valid-journal-title? page)
|
||||
ref-file-path (str (get-directory journal?)
|
||||
"/"
|
||||
(get-file-name journal? page)
|
||||
".org")]
|
||||
ref-file-path (str
|
||||
(if (or (util/electron?) (mobile-util/is-native-platform?))
|
||||
(-> (config/get-repo-dir (state/get-current-repo))
|
||||
js/decodeURI
|
||||
(string/replace #"/+$" "")
|
||||
(str "/"))
|
||||
"")
|
||||
(get-directory journal?)
|
||||
"/"
|
||||
(get-file-name journal? page)
|
||||
".org")]
|
||||
(create! page {:redirect? false})
|
||||
(util/format "[[file:%s][%s]]"
|
||||
(util/get-relative-path edit-block-file-path ref-file-path)
|
||||
|
|
Loading…
Reference in New Issue