Просмотр исходного кода

fix: import with journal refs result in invalid blocks

Gabriel Horner 1 год назад
Родитель
Сommit
99bf950bd1

+ 2 - 2
deps/graph-parser/src/logseq/graph_parser/block.cljs

@@ -320,8 +320,8 @@
                :block/title original-page-name'}
               (when (and original-page-name
                          (not= (string/lower-case original-page-name)
-                               (string/lower-case original-page-name')))
-
+                               (string/lower-case original-page-name'))
+                         (not @*export-to-db-graph?))
                 {:block.temp/original-page-name original-page-name})
               (if (and class? page-entity (:db/ident page-entity))
                 {:block/uuid (:block/uuid page-entity)

+ 2 - 2
deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs

@@ -187,8 +187,8 @@
 
       ;; Counts
       ;; Includes journals as property values e.g. :logseq.task/deadline
-      (is (= 22 (count (d/q '[:find ?b :where [?b :block/type "journal"]] @conn))))
-      (is (= 22 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Journal]] @conn))))
+      (is (= 23 (count (d/q '[:find ?b :where [?b :block/type "journal"]] @conn))))
+      (is (= 23 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Journal]] @conn))))
 
       (is (= 4 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Task]] @conn))))
       (is (= 3 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Query]] @conn))))

+ 1 - 0
deps/graph-parser/test/resources/exporter-test-graph/journals/2024_11_18.md

@@ -1 +1,2 @@
+- Block with journal ref [[Nov 3th, 2020]]
 - Another block with #Quotes/life