Browse Source

fix: block marker/property not updated correctly if removed in the
text

close #1837

Tienson Qin 4 years ago
parent
commit
74958f83f7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/main/frontend/handler/editor.cljs

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

@@ -314,8 +314,9 @@
                              :else
                              (let [content' (str (config/get-block-pattern format) (if heading? " " "\n") content)]
                                [content content']))
-        block (block/parse-block (-> (assoc block :block/content content')
-                                     (dissoc :block/properties)))
+        block (assoc block :block/content content')
+        block (apply dissoc block (remove #{:block/pre-block?} db-schema/retract-attributes))
+        block (block/parse-block block)
         block (if (and first-block? (:block/pre-block? block))
                 block
                 (dissoc block :block/pre-block?))