🐛 Avoid restoring empty saved-font-size to prevent invalid text shapes on save (#9917)

This commit is contained in:
Alejandro Alonso 2026-05-28 12:39:43 +02:00 committed by GitHub
parent 921c5a4294
commit 6663105f4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,7 +66,9 @@
(d/merge txt/default-paragraph-attrs txt/default-text-attrs))
;; Recover real font-size from data attribute, which to_dom/get-paragraph-styles may have
;; changed to "0" ("0" trick to avoid it interfering with height calculation in the browser).
saved-font-size (dom/get-data element "saved-font-size")]
saved-font-size (dom/get-data element "saved-font-size")
saved-font-size (when (and (string? saved-font-size) (not (empty? saved-font-size)))
saved-font-size)]
(cond-> styles
(some? saved-font-size)
(assoc :font-size saved-font-size))))