From 651d4f794be3574f553fda9ddab1dbcb04394e67 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 11 Jan 2023 12:43:42 +0100 Subject: [PATCH] :bug: Fix copy paste line break --- frontend/src/app/main/data/workspace.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index fc55346c91..ff5ba2a521 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1588,8 +1588,10 @@ (map str/trim) (mapv #(hash-map :type "paragraph" :children [(merge txt/default-text-attrs {:text %})])))] - {:type "root" - :children [{:type "paragraph-set" :children paragraphs}]})) + ;; if text is composed only by line breaks paragraphs is an empty list and should be nil + (when (d/not-empty? paragraphs) + {:type "root" + :children [{:type "paragraph-set" :children paragraphs}]}))) (defn calculate-paste-position [state] (cond