浏览代码

fix: multi-line block content not saved

Tienson Qin 1 年之前
父节点
当前提交
9725934af8

+ 1 - 1
src/main/frontend/components/page.cljs

@@ -300,7 +300,7 @@
 
 (rum/defc page-title-configure
   [*show-page-info?]
-  [:div.absolute.-top-4.left-2.fade-in
+  [:div.absolute.-top-4.left-2.fade-in.faster-fade-in
    (shui/button
     {:variant :outline
      :size :xs

+ 3 - 1
src/main/frontend/handler/db_based/editor.cljs

@@ -79,7 +79,9 @@
                       first-elem-type (first (ffirst ast))
                       block-with-title? (mldoc/block-with-title? first-elem-type)
                       content' (str (config/get-block-pattern :markdown) (if block-with-title? " " "\n") content)
-                      block' (merge block (block/parse-block (assoc block :block/content content')))
+                      block' (merge block
+                                    (block/parse-block (assoc block :block/content content'))
+                                    {:block/content content})
                       block' (if (seq (:block/properties block))
                                (update block' :block/properties (fn [m] (merge m (:block/properties block))))
                                block')]

+ 4 - 2
src/main/frontend/handler/editor.cljs

@@ -300,8 +300,10 @@
          page (db/entity repo (:db/id page))
          block-id (when (and (not (config/db-based-graph? repo)) (map? properties))
                     (get properties :id))
-         content (-> (property-file/remove-built-in-properties-when-file-based repo format content)
-                     (drawer/remove-logbook))]
+         content (if (config/db-based-graph? repo)
+                   content
+                   (-> (property-file/remove-built-in-properties-when-file-based repo format content)
+                     (drawer/remove-logbook)))]
      (cond
        (another-block-with-same-id-exists? uuid block-id)
        (notification/show!