From c84e7de0fba56d4fc123e2c0a43daf6849d41e84 Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 14 May 2026 16:18:24 +0800 Subject: [PATCH] fix: preserve spaces between refs in headings --- src/main/frontend/components/block.cljs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 22ebce1a76..d2ea05a0f4 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -1696,13 +1696,23 @@ (search-handler/highlight-exact-query content query) content)) +(defn- preserve-heading-whitespace + [config s] + (if (and (:parent-heading config) + (string? s) + (string/blank? s)) + [:span.whitespace-pre-wrap s] + s)) + (defn ^:large-vars/cleanup-todo inline [{:keys [html-export?] :as config} item] (match item ["Plain" s] - (highlight-query-text s (:highlight-query config)) + (preserve-heading-whitespace + config + (highlight-query-text s (:highlight-query config))) ["Spaces" s] - s + (preserve-heading-whitespace config s) ["Superscript" l] (->elem :sup (map-inline config l))