Skip to content

Commit 23d6f15

Browse files
fix: import of unlinked pdf annotations
This addresses the importer failing for logseq/db-test#732
1 parent 3a3e14b commit 23d6f15

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎deps/graph-parser/src/logseq/graph_parser/exporter.cljs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,12 @@
563563
(translate-linked-ref-filters prop-value page-names-to-uuids)
564564
:ls-type
565565
[[:logseq.property/ls-type (keyword prop-value)]]
566+
:hl-color
567+
(let [color-text-idents
568+
(->> (get-in db-property/built-in-properties [:logseq.property.pdf/hl-color :closed-values])
569+
(map (juxt :value :db-ident))
570+
(into {}))]
571+
[[:logseq.property.pdf/hl-color (get color-text-idents prop-value)]])
566572
;; else
567573
[[(built-in-property-file-to-db-idents prop) prop-value]]))))
568574
(into {}))]

‎deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
(is (= 2 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Pdf-annotation]] @conn))))
221221

222222
;; Properties and tags aren't included in this count as they aren't a Page
223-
(is (= 10
223+
(is (= 11
224224
(->> (d/q '[:find [?b ...]
225225
:where
226226
[?b :block/title]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- This is a highlights page that doesn't start with 'hls__' and isn't linked to a specific asset file
2+
- blarg blarg
3+
ls-type:: annotation
4+
hl-page:: 110
5+
hl-color:: purple
6+
id:: 654bafc6-f7e8-4633-b6a6-810dc41cc559

0 commit comments

Comments
 (0)