mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 01:46:35 +00:00
DB refactor and fix issues related to tags and aliases
1. add a `page` filter. 2. keep word case for both page and block's properties 3. remove `:tag/name` from the db schema Fixed #1031
This commit is contained in:
@@ -194,8 +194,7 @@
|
||||
|
||||
(defn with-page-refs
|
||||
[{:keys [title body tags] :as block}]
|
||||
(let [tags (mapv :tag/name (util/->tags (map :tag/name tags)))
|
||||
ref-pages (atom tags)]
|
||||
(let [ref-pages (atom tags)]
|
||||
(walk/postwalk
|
||||
(fn [form]
|
||||
(when-let [page (get-page-reference form)]
|
||||
@@ -254,12 +253,6 @@
|
||||
(block-keywordize (util/remove-nils block)))
|
||||
blocks))
|
||||
|
||||
(defn collect-block-tags
|
||||
[{:keys [title body tags] :as block}]
|
||||
(cond-> block
|
||||
(seq tags)
|
||||
(assoc :tags (util/->tags tags))))
|
||||
|
||||
(defn extract-blocks
|
||||
[blocks last-pos encoded-content]
|
||||
(let [blocks
|
||||
@@ -319,7 +312,6 @@
|
||||
block (if (seq timestamps)
|
||||
(merge block (timestamps->scheduled-and-deadline timestamps))
|
||||
block)
|
||||
block (collect-block-tags block)
|
||||
block (with-page-refs block)
|
||||
block (with-block-refs block)
|
||||
block (update-src-pos-meta! block)
|
||||
@@ -382,8 +374,7 @@
|
||||
blocks (doall
|
||||
(map-indexed
|
||||
(fn [idx {:block/keys [ref-pages ref-blocks meta] :as block}]
|
||||
(let [block (collect-block-tags block)
|
||||
block (merge
|
||||
(let [block (merge
|
||||
block
|
||||
{:block/meta meta
|
||||
:block/marker (get block :block/marker "nil")
|
||||
|
||||
Reference in New Issue
Block a user