mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 19:06:21 +00:00
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:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user