Browse Source

fix: Right Click 'Make a Card' on Windows App does not work

close #2505
Tienson Qin 4 years ago
parent
commit
8aae5a8dba
1 changed files with 7 additions and 5 deletions
  1. 7 5
      src/main/frontend/extensions/srs.cljs

+ 7 - 5
src/main/frontend/extensions/srs.cljs

@@ -629,8 +629,10 @@
 ;; handlers
 (defn make-block-a-card!
   [block-id]
-  (when-let [content (:block/content (db/entity [:block/uuid block-id]))]
-    (editor-handler/save-block!
-     (state/get-current-repo)
-     block-id
-     (str (string/trim content) " #" card-hash-tag))))
+  (when-let [block (db/entity [:block/uuid block-id])]
+    (when-let [content (:block/content block)]
+      (let [content (property/remove-built-in-properties (:block/format block) content)]
+        (editor-handler/save-block!
+         (state/get-current-repo)
+         block-id
+         (str (string/trim content) " #" card-hash-tag))))))