Skip to content

Commit

Permalink
fix: roam export
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Dec 8, 2022
1 parent 7a5310e commit 4708e60
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/main/frontend/external/roam_export.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 4708e60

Please sign in to comment.