🐛 Add missing styles to the empty node on editor-v1

This commit is contained in:
Andrey Antukh 2025-07-30 11:45:39 +02:00
parent e1c5a32fcb
commit 7fde1436e1
1 changed files with 3 additions and 3 deletions

View File

@ -292,7 +292,7 @@
(fix-gradients)
(assoc :text text))))
(split-texts [text styles]
(split-texts [text styles data]
(let [cpoints (text->code-points text)
children (->> (parse-draft-styles styles)
(build-style-index (count cpoints))
@ -301,7 +301,7 @@
(mapv #(extract-text cpoints %)))]
(cond-> children
(empty? children)
(conj {:text ""}))))
(conj (assoc data :text "")))))
(build-paragraph [block]
(let [key (get block :key)
@ -312,7 +312,7 @@
(-> data
(assoc :key key)
(assoc :type "paragraph")
(assoc :children (split-texts text styles)))))]
(assoc :children (split-texts text styles data)))))]
{:type "root"
:children