mirror of https://github.com/penpot/penpot.git
🐛 Add missing styles to the empty node on editor-v1
This commit is contained in:
parent
e1c5a32fcb
commit
7fde1436e1
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue