🐛 Fix text decoration selection on v3 editor (#12255)

This commit is contained in:
Elena Torró 2026-10-09 15:48:03 +02:00 committed by GitHub
parent c4068a2256
commit 4faac8f746
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -771,11 +771,17 @@
(defn- clean-styles
"Drop nil-valued attrs (unlike the DOM path, our merge would keep them and fail
the backend schema); a per-span fn is passed through untouched."
the backend schema); a per-span fn is passed through untouched. A nil
`:text-decoration` is the panel's toggle-off, so it becomes \"none\"."
[styles]
(if (fn? styles)
styles
(into {} (remove (comp nil? val)) styles)))
(into {}
(keep (fn [[k v]]
(cond
(some? v) [k v]
(= k :text-decoration) [k "none"])))
styles)))
(defn apply-styles-to-selection
"Apply `styles` (attrs map, or a fn per span) to the selected spans; `:with-fills?` also returns `:fills`."