Update local-search.js (#450)

This commit is contained in:
Tron 2024-04-28 09:36:34 +08:00 committed by GitHub
parent 09d91d06b6
commit bda705a5f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ var searchFunc = function(path, filter, wrapperId, searchId, contentId) {
var dataTitleLowerCase = dataTitle.toLowerCase(); var dataTitleLowerCase = dataTitle.toLowerCase();
var dataContent = data.content; var dataContent = data.content;
var dataContentLowerCase = dataContent.toLowerCase(); var dataContentLowerCase = dataContent.toLowerCase();
var dataUrl = data.path; var dataUrl = data.path.startsWith('//') ? data.path.slice(1) : data.path; // 避免文章设置永久链接导致点击打开失败
var indexTitle = -1; var indexTitle = -1;
var indexContent = -1; var indexContent = -1;
var firstOccur = -1; var firstOccur = -1;
@ -167,4 +167,4 @@ utils.jq(() => {
} }
}); });
observer.observe($resultArea, { childList: true }); observer.observe($resultArea, { childList: true });
}); });