fix: preserve uuid when paste text

This commit is contained in:
Tienson Qin
2023-04-18 22:54:29 +08:00
parent e5b123de5d
commit 56074732f2

View File

@@ -30,7 +30,7 @@
text format
{:page-name (:block/name (db/entity page-id))})
blocks' (gp-block/with-parent-and-left page-id blocks)]
(editor-handler/paste-blocks blocks' {}))))
(editor-handler/paste-blocks blocks' {:keep-uuid? true}))))
(defn- paste-segmented-text
[format text]
@@ -221,6 +221,8 @@
(let [clipboard-data (gobj/get e "clipboardData")
html (.getData clipboard-data "text/html")
text (.getData clipboard-data "text")]
(prn {:html html
:text text})
(cond
(and (string/blank? text) (string/blank? html))
(paste-file-if-exists id e)