Move first batch of util fns to graph-parser.util

Still need to fix external.roam
This commit is contained in:
Gabriel Horner
2022-05-03 16:59:41 -04:00
parent af4b55c870
commit 85bd1fecb2
43 changed files with 211 additions and 166 deletions

View File

@@ -1,12 +1,13 @@
(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 (util/safe-re-find priority-reg content))
priority (last (gp-util/safe-re-find priority-reg content))
next-priority (case priority
"A" "B"
@@ -28,7 +29,7 @@
(if-let [matches (seq (util/re-pos new-line-re-pattern content))]
(let [[start-pos content] (last matches)]
(+ start-pos (count content)))
(count (util/safe-re-find re-pattern content)))
(count (gp-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)]