mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: references not calculated right
related to https://github.com/logseq/db-test/issues/436#issuecomment-3217902953
This commit is contained in:
17
deps/db/src/logseq/db/frontend/content.cljs
vendored
17
deps/db/src/logseq/db/frontend/content.cljs
vendored
@@ -113,12 +113,12 @@
|
||||
:or {replace-tag? true}}]
|
||||
(assert (string? title))
|
||||
(let [refs' (->> refs
|
||||
(remove (fn [ref]
|
||||
;; remove uuid references since they're introduced to detect multiple pages
|
||||
;; that have the same name
|
||||
(and (map? ref)
|
||||
(:block.temp/original-page-name ref)
|
||||
(common-util/uuid-string? (:block.temp/original-page-name ref)))))
|
||||
(map (fn [ref]
|
||||
;; remove uuid references since they're introduced to detect multiple pages
|
||||
;; that have the same name
|
||||
(if (and (map? ref) (some-> (:block.temp/original-page-name ref) common-util/uuid-string?))
|
||||
(dissoc ref :block.temp/original-page-name)
|
||||
ref)))
|
||||
(map
|
||||
(fn [ref]
|
||||
(if (and (vector? ref) (= :block/uuid (first ref)))
|
||||
@@ -127,9 +127,8 @@
|
||||
ref)))
|
||||
sort-refs)]
|
||||
(reduce
|
||||
(fn [content {uuid' :block/uuid :block/keys [title] :as block}]
|
||||
(let [title' (or (:block.temp/original-page-name block) title)]
|
||||
(replace-page-ref-with-id content title' uuid' replace-tag?)))
|
||||
(fn [content {uuid' :block/uuid :block/keys [title]}]
|
||||
(replace-page-ref-with-id content title uuid' replace-tag?))
|
||||
title
|
||||
(filter :block/title refs'))))
|
||||
|
||||
|
||||
3
deps/outliner/src/logseq/outliner/core.cljs
vendored
3
deps/outliner/src/logseq/outliner/core.cljs
vendored
@@ -617,6 +617,7 @@
|
||||
(when (:block/uuid target-block)
|
||||
(d/entity db [:block/uuid (:block/uuid target-block)])))]
|
||||
(let [linked (:block/link block)
|
||||
library? (ldb/library? block)
|
||||
up-down? (= outliner-op :move-blocks-up-down)
|
||||
[block sibling?] (cond
|
||||
up-down?
|
||||
@@ -648,7 +649,7 @@
|
||||
[last-child true]
|
||||
[block false])
|
||||
:else
|
||||
[block sibling?])
|
||||
[block (if library? false sibling?)])
|
||||
|
||||
linked
|
||||
(get-last-child-or-self db linked)
|
||||
|
||||
Reference in New Issue
Block a user