From 89c229fd2827816486faf67f861235a4375e55ac Mon Sep 17 00:00:00 2001 From: luke Date: Fri, 20 Jun 2025 01:32:24 +0800 Subject: [PATCH] fix --- scripts/popup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/popup.js b/scripts/popup.js index 5378f54..0d22621 100644 --- a/scripts/popup.js +++ b/scripts/popup.js @@ -177,10 +177,10 @@ document.addEventListener("DOMContentLoaded", async () => { results.forEach(doc => { const li = document.createElement("li"); const filename = doc.filename || doc.title || "未知文件"; - const url = doc.url || ""; + const filepath = doc.filepath?.replace(/^import-data\//, "").replace(/\.md$/, ".html") || ""; const mtime = doc.mtime ? formatLocalTime(doc.mtime) : ""; // 格式化时间 const link = document.createElement("a"); - link.href = `${url}`; + link.href = doc.url ? doc.url : `${fileBaseUrl}/${filepath || filename}`; link.target = "_blank"; link.textContent = filename;