Merge pull request #106 from tangly1024/bugfix_search

修复搜索bug
This commit is contained in:
tangly1024
2022-03-25 17:41:21 +08:00
committed by GitHub

View File

@@ -120,7 +120,10 @@ async function filterByMemCache (allPosts, keyword) {
let hitCount = 0
for (const i in indexContent) {
const c = indexContent[i]
const index = c.toLowerCase().indexOf(keyword.toLowerCase())
if (!c) {
continue
}
const index = c.toLowerCase().indexOf(keyword.toLowerCase()) || -1
if (index > -1) {
hit = true
hitCount += 1