Explorar el Código

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 hace 1 año
padre
commit
4cb793e1e8
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  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]
   [refs]
   (sort-by
   (sort-by
    (fn [ref]
    (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))
    refs))