Browse Source

fix: can't link a block via ID & a page in the same block

fixes https://github.com/logseq/db-test/issues/178
Tienson Qin 1 year ago
parent
commit
4cb793e1e8
1 changed files with 3 additions and 2 deletions
  1. 3 2
      deps/db/src/logseq/db/frontend/content.cljs

+ 3 - 2
deps/db/src/logseq/db/frontend/content.cljs

@@ -32,8 +32,9 @@
   [refs]
   (sort-by
    (fn [ref]
-     [(boolean (re-find page-ref/page-ref-without-nested-re (:block/title ref)))
-      (:block/title ref)])
+     (when-let [title (and (map? ref) (:block/title ref))]
+       [(boolean (re-find page-ref/page-ref-without-nested-re (:block/title ref)))
+        title]))
    >
    refs))