fix: roam export

This commit is contained in:
Tienson Qin
2022-12-08 21:15:47 +08:00
parent 7a5310eb5d
commit 4708e6067d

View File

@@ -33,14 +33,15 @@
(into {}))))
(defn update-content [content uuid->uid-map]
(let [uuids (keys uuid->uid-map)]
(reduce
(fn [acc uuid]
(if (str/includes? acc (str uuid))
(str/replace acc (str uuid) (get uuid->uid-map uuid))
acc))
content
uuids)))
(when content ; page block doesn't have content
(let [uuids (keys uuid->uid-map)]
(reduce
(fn [acc uuid]
(if (str/includes? acc (str uuid))
(str/replace acc (str uuid) (get uuid->uid-map uuid))
acc))
content
uuids))))
(defn update-uid [{:block/keys [uuid content] :as b}
uuid->uid-map]