|
@@ -707,7 +707,11 @@
|
|
|
[block sibling?]
|
|
[block sibling?]
|
|
|
(let [target (or linked block)]
|
|
(let [target (or linked block)]
|
|
|
(if (and up?
|
|
(if (and up?
|
|
|
|
|
+ ;; target is not any parent of the first block
|
|
|
(not= (:db/id (:block/parent (first blocks)))
|
|
(not= (:db/id (:block/parent (first blocks)))
|
|
|
|
|
+ (:db/id target))
|
|
|
|
|
+ (not= (:db/id (:block/parent
|
|
|
|
|
+ (db/entity (:db/id (:block/parent (first blocks))))))
|
|
|
(:db/id target)))
|
|
(:db/id target)))
|
|
|
(get-last-child-or-self target)
|
|
(get-last-child-or-self target)
|
|
|
[target false])))
|
|
[target false])))
|
|
@@ -723,10 +727,6 @@
|
|
|
|
|
|
|
|
:else
|
|
:else
|
|
|
[block sibling?])]
|
|
[block sibling?])]
|
|
|
- ;; (prn :debug {:result result
|
|
|
|
|
- ;; :sibling? sibling?
|
|
|
|
|
- ;; :block {:db/id (:db/id block)
|
|
|
|
|
- ;; :block/content (:block/content block)}})
|
|
|
|
|
result)))
|
|
result)))
|
|
|
|
|
|
|
|
(defn insert-blocks
|
|
(defn insert-blocks
|