Merge remote-tracking branch 'upstream/master' into whiteboards

This commit is contained in:
Peng Xiao
2022-08-03 14:12:10 +08:00
24 changed files with 852 additions and 768 deletions

View File

@@ -30,8 +30,8 @@
content
(when (and content q)
(let [q-words (string/split q #" ")
lc-content (util/search-normalize content)
lc-q (util/search-normalize q)]
lc-content (util/search-normalize content (state/enable-search-remove-accents?))
lc-q (util/search-normalize q (state/enable-search-remove-accents?))]
(if (and (string/includes? lc-content lc-q)
(not (util/safe-re-find #" " q)))
(let [i (string/index-of lc-content lc-q)
@@ -47,8 +47,8 @@
result []]
(if (and (seq words) content)
(let [word (first words)
lc-word (util/search-normalize word)
lc-content (util/search-normalize content)]
lc-word (util/search-normalize word (state/enable-search-remove-accents?))
lc-content (util/search-normalize content (state/enable-search-remove-accents?))]
(if-let [i (string/index-of lc-content lc-word)]
(recur (rest words)
(subs content (+ i (count word)))