fix: convert keywords to str when exporting if there're commas

pull/6486/head
Tienson Qin 2022-08-25 20:19:26 +08:00
parent a94b4aac35
commit 251867dcf8
2 changed files with 19 additions and 7 deletions

View File

@ -444,6 +444,16 @@
x))
vec-tree))
(defn- keyword-with-commas->str
[block]
(update block :block/properties
(fn [properties]
(when (seq properties)
(update-keys properties (fn [k]
(if (string/includes? (str k) ",")
(subs (str k) 1)
k)))))))
(defn- blocks [db]
{:version 1
:blocks
@ -460,12 +470,14 @@
name
{:transform? false})
blocks' (map (fn [b]
(if (seq (:block/properties b))
(update b :block/content
(fn [content] (property/remove-properties (:block/format b) content)))
b)) blocks)
children (outliner-tree/blocks->vec-tree blocks' name)]
(assoc page :block/children children))))
(let [b' (if (seq (:block/properties b))
(update b :block/content
(fn [content] (property/remove-properties (:block/format b) content)))
b)]
(keyword-with-commas->str b'))) blocks)
children (outliner-tree/blocks->vec-tree blocks' name)
page' (keyword-with-commas->str page)]
(assoc page' :block/children children))))
(nested-select-keys
[:block/id
:block/page-name

View File

@ -203,7 +203,7 @@
(catch :default e
(js/console.error e)
(notification/show!
(str (:message e))
(str (.-message e))
:error)))) ;; it was designed to accept a list of imported page names but now deprecated
(defn tree-vec-translate-json