mirror of https://github.com/logseq/logseq
Jakob IV
parent
2ab619e44a
commit
79a11f8b88
|
@ -37,16 +37,16 @@
|
||||||
(let [start-index (string/index-of normal-text normal-query)
|
(let [start-index (string/index-of normal-text normal-query)
|
||||||
end-index (+ start-index (count query))
|
end-index (+ start-index (count query))
|
||||||
text-string (cond-> (or text "") (keyword? text) name :always str)]
|
text-string (cond-> (or text "") (keyword? text) name :always str)]
|
||||||
[(subs text-string 0 start-index)
|
[(or (subs text-string 0 start-index) "")
|
||||||
(subs text-string start-index end-index)
|
(or (subs text-string start-index end-index) "")
|
||||||
(subs text-string end-index)]))
|
(or (subs text-string end-index) "")]))
|
||||||
|
|
||||||
(defn span-with-single-highlight-token [text query normal-text normal-query]
|
(defn span-with-single-highlight-token [text query normal-text normal-query]
|
||||||
(let [[before-text highlighted-text after-text] (split-text-on-highlight text query normal-text normal-query)]
|
(let [[before-text highlighted-text after-text] (split-text-on-highlight text query normal-text normal-query)]
|
||||||
[:span
|
[:span
|
||||||
(when-not (string/blank? before-text) [:span before-text])
|
(when-not (string/blank? before-text) [:span before-text])
|
||||||
(when-not (string/blank? highlighted-text) [:span {:class "bg-accent-06 dark:bg-accent-08-alpha"} highlighted-text])
|
(when-not (string/blank? after-text) [:span after-text])
|
||||||
(when-not (string/blank? after-text) [:span after-text])]))
|
(when-not (string/blank? highlighted-text) [:span {:class "bg-accent-06 dark:bg-accent-08-alpha"} highlighted-text])]))
|
||||||
|
|
||||||
(defn span-with-mutliple-highlight-tokens [app-config text query normal-text normal-query]
|
(defn span-with-mutliple-highlight-tokens [app-config text query normal-text normal-query]
|
||||||
(loop [[query-token & more] (string/split normal-query #" ")
|
(loop [[query-token & more] (string/split normal-query #" ")
|
||||||
|
|
|
@ -227,7 +227,8 @@
|
||||||
"database") {:size (if logged-in? 12 16)
|
"database") {:size (if logged-in? 12 16)
|
||||||
:id "database-icon"
|
:id "database-icon"
|
||||||
:class (when logged-in? "p-1 rounded")
|
:class (when logged-in? "p-1 rounded")
|
||||||
:style {:background-color "var(--lx-gray-06-alpha, var(--color-level-5))"}})]
|
:style {:background-color "var(--lx-gray-06-alpha, var(--color-level-5))"
|
||||||
|
:padding 3}})]
|
||||||
[:div.graphs
|
[:div.graphs
|
||||||
[:span#repo-switch.block.pr-2.whitespace-nowrap
|
[:span#repo-switch.block.pr-2.whitespace-nowrap
|
||||||
[:span [:span#repo-name.font-medium
|
[:span [:span#repo-name.font-medium
|
||||||
|
|
Loading…
Reference in New Issue