0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

🐛 Fix copy paste line break

This commit is contained in:
Alejandro Alonso 2023-01-11 12:43:42 +01:00 committed by Alonso Torres
parent 58aa6b3666
commit 651d4f794b

View file

@ -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