From bda705a5f4b590af02fa579926b33901e7ab4393 Mon Sep 17 00:00:00 2001 From: Tron Date: Sun, 28 Apr 2024 09:36:34 +0800 Subject: [PATCH] Update local-search.js (#450) --- source/js/search/local-search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/js/search/local-search.js b/source/js/search/local-search.js index 964d7ae..0118ea1 100644 --- a/source/js/search/local-search.js +++ b/source/js/search/local-search.js @@ -64,7 +64,7 @@ var searchFunc = function(path, filter, wrapperId, searchId, contentId) { var dataTitleLowerCase = dataTitle.toLowerCase(); var dataContent = data.content; var dataContentLowerCase = dataContent.toLowerCase(); - var dataUrl = data.path; + var dataUrl = data.path.startsWith('//') ? data.path.slice(1) : data.path; // 避免文章设置永久链接导致点击打开失败 var indexTitle = -1; var indexContent = -1; var firstOccur = -1; @@ -167,4 +167,4 @@ utils.jq(() => { } }); observer.observe($resultArea, { childList: true }); - }); \ No newline at end of file + });