mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 19:06:21 +00:00
refactor: consistent alias of clojure.string
This commit is contained in:
28
src/main/frontend/external/roam_export.cljs
vendored
28
src/main/frontend/external/roam_export.cljs
vendored
@@ -1,6 +1,6 @@
|
||||
(ns ^:no-doc frontend.external.roam-export
|
||||
(:require [clojure.set :as s]
|
||||
[clojure.string :as str]
|
||||
[clojure.string :as string]
|
||||
[clojure.walk :as walk]
|
||||
[frontend.db.async :as db-async]
|
||||
[frontend.state :as state]
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
(defn nano-id []
|
||||
(->> (repeatedly 9 nano-id-char)
|
||||
(str/join)))
|
||||
(string/join)))
|
||||
|
||||
(defn <uuid->uid-map []
|
||||
(let [repo (state/get-current-repo)]
|
||||
@@ -36,13 +36,13 @@
|
||||
(defn update-content [content uuid->uid-map]
|
||||
(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))))
|
||||
(reduce
|
||||
(fn [acc uuid]
|
||||
(if (string/includes? acc (str uuid))
|
||||
(string/replace acc (str uuid) (get uuid->uid-map uuid))
|
||||
acc))
|
||||
content
|
||||
uuids))))
|
||||
|
||||
(defn update-uid [{:block/keys [uuid title] :as b}
|
||||
uuid->uid-map]
|
||||
@@ -50,7 +50,7 @@
|
||||
(contains? uuid->uid-map uuid)
|
||||
(assoc :block/uid (get uuid->uid-map uuid))
|
||||
|
||||
(some (fn [id] (str/includes? (str title) (str id))) (keys uuid->uid-map))
|
||||
(some (fn [id] (string/includes? (str title) (str id))) (keys uuid->uid-map))
|
||||
(update :block/title #(update-content % uuid->uid-map))))
|
||||
|
||||
(defn update-todo [{:block/keys [title] :as block}]
|
||||
@@ -58,10 +58,10 @@
|
||||
(update block :block/title
|
||||
(fn [c]
|
||||
(-> c
|
||||
(str/replace todo-marker-regex "{{[[TODO]]}}")
|
||||
(str/replace done-marker-regex "{{[[DONE]]}}")
|
||||
(str/replace "{{embed " "{{embed: ")
|
||||
(str/trim))))
|
||||
(string/replace todo-marker-regex "{{[[TODO]]}}")
|
||||
(string/replace done-marker-regex "{{[[DONE]]}}")
|
||||
(string/replace "{{embed " "{{embed: ")
|
||||
(string/trim))))
|
||||
block))
|
||||
|
||||
(defn traverse
|
||||
|
||||
Reference in New Issue
Block a user