pull/11088/head
j-ramos 2024-03-03 20:27:24 +01:00 committed by Andelf
parent f5bf5a4bfb
commit 10c18b165a
1 changed files with 7 additions and 2 deletions

View File

@ -2342,8 +2342,13 @@
(defn toggle-list-checkbox
[{:block/keys [content] :as block} old-item-content new-item-content]
(let [new-content (string/replace-first content old-item-content new-item-content)]
(save-block-if-changed! block new-content)))
(let [replace-first #(string/replace-first content % new-item-content)
new-content (replace-first old-item-content)]
(save-block-if-changed!
block
(if (= new-content content)
(replace-first (string/replace old-item-content "[X]" "[x]"))
new-content))))
(defn- dwim-in-list
[]