mirror of https://github.com/logseq/logseq
fix: convert keywords to str when exporting if there're commas
parent
a94b4aac35
commit
251867dcf8
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue