mirror of https://github.com/logseq/logseq
fix: search query is sometimes marked at the beginning
parent
97ecc4b8ed
commit
b3baf7cd76
|
@ -32,7 +32,7 @@
|
||||||
(let [q-words (string/split q #" ")
|
(let [q-words (string/split q #" ")
|
||||||
lc-content (string/lower-case content)
|
lc-content (string/lower-case content)
|
||||||
lc-q (string/lower-case q)]
|
lc-q (string/lower-case q)]
|
||||||
(if (or (string/includes? lc-content lc-q)
|
(if (and (string/includes? lc-content lc-q)
|
||||||
(not (util/safe-re-find #" " q)))
|
(not (util/safe-re-find #" " q)))
|
||||||
(let [i (string/index-of lc-content lc-q)
|
(let [i (string/index-of lc-content lc-q)
|
||||||
[before after] [(subs content 0 i) (subs content (+ i (count q)))]]
|
[before after] [(subs content 0 i) (subs content (+ i (count q)))]]
|
||||||
|
|
Loading…
Reference in New Issue