角色标签构建优化 (#2595)

This commit is contained in:
躁动的氨气
2025-12-30 20:39:54 +08:00
committed by GitHub
parent cabad8b7ad
commit d11903f491

View File

@@ -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);