mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 17:06:23 +00:00
enhance: replace inline tags with node references
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
[frontend.format.mldoc :as mldoc]
|
||||
[lambdaisland.glogi :as log]
|
||||
[promesa.core :as p]
|
||||
[frontend.config :as config]))
|
||||
[frontend.config :as config]
|
||||
[logseq.db.frontend.content :as db-content]))
|
||||
|
||||
(defn- paste-text-parseable
|
||||
[format text]
|
||||
@@ -28,7 +29,16 @@
|
||||
(mldoc/->edn text format)
|
||||
text format
|
||||
{:page-name (:block/name (db/entity page-id))})
|
||||
blocks' (gp-block/with-parent-and-order page-id blocks)]
|
||||
db-based? (config/db-based-graph? (state/get-current-repo))
|
||||
blocks' (cond->> (gp-block/with-parent-and-order page-id blocks)
|
||||
db-based?
|
||||
(map (fn [block]
|
||||
(let [refs (:block/refs block)]
|
||||
(-> block
|
||||
(dissoc :block/tags)
|
||||
(update :block/title (fn [title]
|
||||
(-> (db-content/replace-tags-with-page-refs title refs)
|
||||
(db-content/page-ref->special-id-ref refs)))))))))]
|
||||
(editor-handler/paste-blocks blocks' {:keep-uuid? true}))))
|
||||
|
||||
(defn- paste-segmented-text
|
||||
|
||||
Reference in New Issue
Block a user