diff --git a/deps/graph-parser/src/logseq/graph_parser/exporter.cljs b/deps/graph-parser/src/logseq/graph_parser/exporter.cljs index d35014dde3..bf92323c4c 100644 --- a/deps/graph-parser/src/logseq/graph_parser/exporter.cljs +++ b/deps/graph-parser/src/logseq/graph_parser/exporter.cljs @@ -715,7 +715,7 @@ ;; that aren't conrolled by :classes-tx (cond-> block (seq parent-classes-from-properties) - (merge (find-or-create-class db (:block/title block) (:all-idents import-state) block)) + (merge (find-or-create-class db ((some-fn ::original-title :block/title) block) (:all-idents import-state) block)) (seq parent-classes-from-properties) (assoc :logseq.property/parent (let [new-class (first parent-classes-from-properties) diff --git a/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs b/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs index 8b8022fe3b..c1051d9104 100644 --- a/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs +++ b/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs @@ -603,14 +603,18 @@ (deftest-async export-files-with-property-parent-classes-option (p/let [file-graph-dir "test/resources/exporter-test-graph" - files (mapv #(node-path/join file-graph-dir %) ["pages/CreativeWork.md" "pages/Movie.md" "pages/type.md"]) + files (mapv #(node-path/join file-graph-dir %) ["pages/CreativeWork.md" "pages/Movie.md" "pages/type.md" + "pages/Whiteboard___Tool.md" "pages/Whiteboard___Arrow_head_toggle.md"]) conn (db-test/create-conn) - _ (import-files-to-db files conn {:property-parent-classes ["parent"]})] + _ (import-files-to-db files conn {:property-parent-classes ["parent"] + ;; Also add this option to trigger some edge cases with namespace pages + :property-classes ["type"]})] (is (empty? (map :entity (:errors (db-validate/validate-db! @conn)))) "Created graph has no validation errors") - (is (= #{:user.class/Movie :user.class/CreativeWork :user.class/Thing} + (is (= #{:user.class/Movie :user.class/CreativeWork :user.class/Thing + :user.class/Class :user.class/Tool :user.class/Whiteboard___Tool} (->> @conn (d/q '[:find [?ident ...] :where [?b :block/type "class"] [?b :db/ident ?ident] (not [?b :logseq.property/built-in?])])