From 37b50497f3eb321049959584f64bf79c336fa6c3 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 27 Nov 2024 11:51:13 +0100 Subject: [PATCH] :bug: Fix problem with editor line-height --- frontend/src/app/util/text/content/to_dom.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/util/text/content/to_dom.cljs b/frontend/src/app/util/text/content/to_dom.cljs index fbf089018..f1f6a994d 100644 --- a/frontend/src/app/util/text/content/to_dom.cljs +++ b/frontend/src/app/util/text/content/to_dom.cljs @@ -73,11 +73,14 @@ ;; it affects to the height calculation the browser does font-size (if (some #(not= "" (:text %)) (:children paragraph)) "0" - (:font-size styles (:font-size txt/default-text-attrs)))] - (cond-> styles - ;; Every paragraph must have line-height to be correctly rendered - (nil? (:line-height styles)) (assoc :line-height (:line-height txt/default-text-attrs)) - true (assoc :font-size font-size)))) + (:font-size styles (:font-size txt/default-text-attrs))) + + line-height (:line-height styles) + line-height (if (and (some? line-height) (not= "" line-height)) + line-height + (:line-height txt/default-text-attrs))] + (-> styles + (assoc :font-size font-size :line-height line-height)))) (defn get-root-styles [root]