mirror of https://github.com/logseq/logseq
fix: schedule doesn't work well with logbook together
parent
98cb06b86e
commit
76595cc69b
|
@ -339,9 +339,7 @@
|
|||
content (if (and (seq properties) real-content (not= real-content content))
|
||||
(property/with-built-in-properties properties content format)
|
||||
content)
|
||||
content (->> content
|
||||
(drawer/remove-logbook)
|
||||
(drawer/with-logbook block))
|
||||
content (drawer/with-logbook block content)
|
||||
content (with-timetracking block content)
|
||||
first-block? (= left page)
|
||||
ast (mldoc/->edn (string/trim content) (mldoc/default-config format))
|
||||
|
@ -790,6 +788,7 @@
|
|||
(reduce (fn [content [old new]]
|
||||
(string/replace content old new))
|
||||
content))
|
||||
content (clock/clock-out format content)
|
||||
content (drawer/insert-drawer
|
||||
format content "logbook"
|
||||
(util/format (str (if (= :org format) "-" "*")
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
before (subvec lines 0 (inc properties-count))
|
||||
after (rest lines)]
|
||||
(string/join "\n" (concat before [drawer] after))))
|
||||
(str title "\n" drawer body)))
|
||||
(str title "\n" drawer "\n" body)))
|
||||
|
||||
(and has-typ-drawer?
|
||||
(>= start-idx 0) (> end-idx 0) (> end-idx start-idx))
|
||||
|
@ -114,12 +114,16 @@
|
|||
|
||||
(defn with-logbook
|
||||
[block content]
|
||||
(let [body (:block/body block)
|
||||
(let [new-clocks (last (get-drawer-ast (:block/format block) content "logbook"))
|
||||
body (:block/body block)
|
||||
logbook (get-logbook body)]
|
||||
(if logbook
|
||||
(let [clocks (map string/trim (last logbook))
|
||||
(let [content (remove-logbook content)
|
||||
clocks (->> (concat new-clocks (last logbook))
|
||||
(distinct))
|
||||
clocks (->> (map string/trim clocks)
|
||||
(remove string/blank?))
|
||||
logbook (->> (concat [":LOGBOOK:"] clocks [":END:"])
|
||||
(remove string/blank?)
|
||||
(string/join "\n"))
|
||||
lines (string/split-lines content)]
|
||||
(if (:block/title block)
|
||||
|
|
Loading…
Reference in New Issue