mirror of https://github.com/logseq/logseq
fix: trailing whitespace disappears
parent
9569bed720
commit
f5af62ad15
|
@ -6,7 +6,8 @@
|
|||
[frontend.util.cursor :as cursor]
|
||||
[goog.dom :as gdom]
|
||||
[frontend.db :as db]
|
||||
[frontend.handler.block :as block-handler]))
|
||||
[frontend.handler.block :as block-handler]
|
||||
[clojure.string :as string]))
|
||||
|
||||
(defn did-mount!
|
||||
[state]
|
||||
|
@ -31,11 +32,11 @@
|
|||
state)
|
||||
|
||||
(defn will-remount!
|
||||
[old-state state]
|
||||
(let [old-block (:block (first (:rum/args old-state)))
|
||||
new-block (:block (first (:rum/args state)))
|
||||
[_old-state state]
|
||||
(let [new-block (:block (first (:rum/args state)))
|
||||
repo (state/get-current-repo)]
|
||||
(when (not= (:block/content old-block) (:block/content new-block))
|
||||
(when (not= (string/trim (state/get-edit-content))
|
||||
(string/trim (:block/content new-block)))
|
||||
(util/set-change-value (state/get-input)
|
||||
(block-handler/sanity-block-content repo (get new-block :block/format :markdown) (:block/content new-block)))))
|
||||
(keyboards-handler/esc-save! state)
|
||||
|
|
Loading…
Reference in New Issue