Decouple graph-parser util from app util usage

For tiny util heavily used fns like safe-re-find and uuid-string?,
decouple graph-parser from so much of the app
This commit is contained in:
Gabriel Horner
2022-05-13 16:17:43 -04:00
parent b9bbd0c605
commit 5b0d5fb8b5
27 changed files with 88 additions and 83 deletions

View File

@@ -1,13 +1,12 @@
(ns frontend.util.priority
(:require [clojure.string :as string]
[frontend.util :as util]
[logseq.graph-parser.util :as gp-util]
[frontend.util.marker :as marker]))
(defn cycle-priority-state
[content]
(let [priority-reg #"\[#([ABC]{1})\]\s{1}"
priority (last (gp-util/safe-re-find priority-reg content))
priority (last (util/safe-re-find priority-reg content))
next-priority (case priority
"A" "B"
@@ -29,7 +28,7 @@
(if-let [matches (seq (util/re-pos new-line-re-pattern content))]
(let [[start-pos content] (last matches)]
(+ start-pos (count content)))
(count (gp-util/safe-re-find re-pattern content)))
(count (util/safe-re-find re-pattern content)))
skip-marker-pos
(if-let [matches (seq (util/re-pos marker/bare-marker-pattern (subs content skip-hash-pos)))]
(let [[start-pos content] (last matches)]