fix: search query is sometimes marked at the beginning

pull/2325/head
Peng Xiao 2021-06-29 01:53:48 +08:00 committed by Tienson Qin
parent 97ecc4b8ed
commit b3baf7cd76
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@
(let [q-words (string/split q #" ")
lc-content (string/lower-case content)
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)))
(let [i (string/index-of lc-content lc-q)
[before after] [(subs content 0 i) (subs content (+ i (count q)))]]