mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
Fix zotero highlighting block error after importing from file
This commit is contained in:
@@ -198,12 +198,24 @@
|
||||
(ref/->block-ref (:block/uuid ref-block))
|
||||
:owner-window (pdf-windows/resolve-own-window viewer)))))
|
||||
|
||||
(defn- get-zotero-local-pdf-path
|
||||
[{:keys [zotero-linked-file zotero-imported-file]}]
|
||||
(let [zotero-config (get-in (state/sub-config) [:zotero/settings-v2 "default"])
|
||||
zotero-data-directory (:zotero-data-directory zotero-config)
|
||||
zotero-linked-attachment-base-directory (:zotero-linked-attachment-base-directory zotero-config)]
|
||||
(if zotero-linked-file
|
||||
(str zotero-linked-attachment-base-directory "/" zotero-linked-file)
|
||||
(str zotero-data-directory "/storage/" zotero-imported-file))))
|
||||
|
||||
(defn db-based-open-block-ref!
|
||||
[block]
|
||||
(let [hl-value (:logseq.property.pdf/hl-value block)
|
||||
asset (:logseq.property/asset block)
|
||||
external-url (:logseq.property.asset/external-url asset)
|
||||
file-path (or external-url (str "../assets/" (:block/uuid asset) ".pdf"))]
|
||||
file-path (or external-url (str "../assets/" (:block/uuid asset) ".pdf"))
|
||||
file-path (if (string/starts-with? file-path "zotero://")
|
||||
(get-zotero-local-pdf-path (:logseq.property.asset/external-props asset))
|
||||
file-path)]
|
||||
(if asset
|
||||
(->
|
||||
(p/let [href (assets-handler/<make-asset-url file-path)]
|
||||
|
||||
@@ -186,7 +186,8 @@
|
||||
["65.17" {:properties [:logseq.property.publish/published-url]}]
|
||||
["65.18" {:fix deprecated-ensure-graph-uuid}]
|
||||
["65.19" {:properties [:logseq.property/choice-classes :logseq.property/choice-exclusions]}]
|
||||
["65.20" {:properties [:logseq.property.class/bidirectional-property-title :logseq.property.class/enable-bidirectional?]}]])
|
||||
["65.20" {:properties [:logseq.property.class/bidirectional-property-title :logseq.property.class/enable-bidirectional?]}]
|
||||
["65.21" {:properties [:logseq.property.asset/external-props]}]])
|
||||
|
||||
(let [[major minor] (last (sort (map (comp (juxt :major :minor) db-schema/parse-schema-version first)
|
||||
schema-version->updates)))]
|
||||
|
||||
Reference in New Issue
Block a user