mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 18:06:32 +00:00
feat: add copy block embed(s)
This commit is contained in:
@@ -1181,6 +1181,19 @@
|
||||
(set-block-id! id))
|
||||
(util/copy-to-clipboard! ids-str))))
|
||||
|
||||
(defn copy-block-embeds
|
||||
[]
|
||||
(when-let [blocks (seq (get-selected-blocks-with-children))]
|
||||
(let [ids (->> (distinct (map #(when-let [id (dom/attr % "blockid")]
|
||||
(uuid id)) blocks))
|
||||
(remove nil?))
|
||||
ids-str (some->> ids
|
||||
(map (fn [id] (util/format "{{embed ((%s))}}" id)))
|
||||
(string/join "\n\n"))]
|
||||
(doseq [id ids]
|
||||
(set-block-id! id))
|
||||
(util/copy-to-clipboard! ids-str))))
|
||||
|
||||
(defn get-selected-toplevel-block-uuids
|
||||
[]
|
||||
(when-let [blocks (seq (get-selected-blocks-with-children))]
|
||||
|
||||
Reference in New Issue
Block a user