From d11903f49180543cc0079c5115bb96860f07ad51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BA=81=E5=8A=A8=E7=9A=84=E6=B0=A8=E6=B0=94?= <131591012+zaodonganqi@users.noreply.github.com> Date: Tue, 30 Dec 2025 20:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=A0=87=E7=AD=BE=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E4=BC=98=E5=8C=96=20(#2595)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/build.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build/build.js b/build/build.js index b5dc426e3..602ce2cbe 100644 --- a/build/build.js +++ b/build/build.js @@ -301,10 +301,14 @@ function extractInfoFromCombatFile(filePath) { const authorMatch = content.match(/\/\/\s*作者\s*[::](.*)/); const descriptionMatch = content.match(/\/\/\s*描述\s*[::](.*)/); const versionMatch = content.match(/\/\/\s*版本\s*[::](.*)/); - const characterMatches = content.match(/^(?!\/\/).*?(\S+)(?=\s|$)/gm); - let tags = [...new Set(characterMatches || [])] - .map(char => char.trim()) - .filter(char => char.length > 0 && !char.match(/^[,.]$/)); // 过滤掉单个逗号或句号 + const lines = content.split('\n'); + + const tags = [...new Set( + lines + .map(l => l.trim()) + .filter(l => l && !l.startsWith('//')) + .map(l => l.split(/\s+/)[0]) + )]; // 获取最后更新时间 const gitTimestamp = getGitTimestamp(filePath);