From 4cb793e1e89a147649ebc73633d42309658b07ed Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sun, 15 Dec 2024 20:50:56 +0800 Subject: [PATCH] fix: can't link a block via ID & a page in the same block fixes https://github.com/logseq/db-test/issues/178 --- deps/db/src/logseq/db/frontend/content.cljs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deps/db/src/logseq/db/frontend/content.cljs b/deps/db/src/logseq/db/frontend/content.cljs index 08d906b3dac..4c2c4bae2a1 100644 --- a/deps/db/src/logseq/db/frontend/content.cljs +++ b/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))