fix: 修復上次更新導致部分用户本地搜索文章鏈接跳轉錯誤的bugs close #375

This commit is contained in:
Jerry 2020-09-21 13:59:32 +08:00
parent a2551d2d29
commit d5670e25e4
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "hexo-theme-butterfly",
"version": "3.2.0-b6",
"version": "3.2.0-b7",
"description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json",
"scripts": {

View File

@ -62,7 +62,7 @@ $(function () {
return {
title: $('title', this).text(),
content: $('content', this).text(),
url: GLOBAL_CONFIG.root + $('url', this).text()
url: $('url', this).text()
}
}).get()
@ -85,7 +85,7 @@ $(function () {
}
let dataTitle = data.title.trim().toLowerCase()
const dataContent = data.content.trim().replace(/<[^>]+>/g, '').toLowerCase()
const dataUrl = data.url
const dataUrl = data.url.startsWith('/') ? data.url : GLOBAL_CONFIG.root + data.url
let indexTitle = -1
let indexContent = -1
let firstOccur = -1