diff --git a/build/build.js b/build/build.js index 0af39ff5..c9924241 100644 --- a/build/build.js +++ b/build/build.js @@ -9,6 +9,10 @@ function calculateSHA1(filePath) { return hashSum.digest('hex'); } +function convertNewlines(text) { + return text.replace(/\\n/g, '\n'); +} + function extractInfoFromCombatFile(filePath) { const content = fs.readFileSync(filePath, 'utf8'); const authorMatch = content.match(/\/\/\s*作者:(.*)/); @@ -21,7 +25,7 @@ function extractInfoFromCombatFile(filePath) { return { author: authorMatch ? authorMatch[1].trim() : '', - description: descriptionMatch ? descriptionMatch[1].trim() : '', + description: descriptionMatch ? convertNewlines(descriptionMatch[1].trim()) : '', tags: tags }; } @@ -34,7 +38,7 @@ function extractInfoFromJSFolder(folderPath) { const manifest = JSON.parse(manifestContent); return { version: manifest.version || '', - description: manifest.description || '', + description: convertNewlines(manifest.description || ''), author: manifest.authors && manifest.authors.length > 0 ? manifest.authors[0].name : '', tags: [] }; @@ -51,7 +55,7 @@ function extractInfoFromPathingFile(filePath, parentFolders) { const content = JSON.parse(fs.readFileSync(filePath, 'utf8')); return { author: content.info && content.info.author ? content.info.author : '', - description: '', + description: convertNewlines(content.info && content.info.description ? content.info.description : ''), tags: parentFolders.slice(2) // 从第三个元素开始,跳过 'pathing' 和下一级目录 }; } @@ -73,7 +77,7 @@ function extractInfoFromTCGFile(filePath, parentFolder) { return { author: authorMatch ? authorMatch[1].trim() : '', - description: descriptionMatch ? descriptionMatch[1].trim() : '', + description: descriptionMatch ? convertNewlines(descriptionMatch[1].trim()) : '', tags: [...new Set(tags)] // 去重 }; } diff --git a/build/tree.json b/build/tree.json index eced5cce..22e41d94 100644 --- a/build/tree.json +++ b/build/tree.json @@ -273,7 +273,7 @@ "hash": "c60bd5e36c893a00761879c5936b502fb3a30911", "version": "c60bd5e", "author": "柠檬茶叶", - "description": "", + "description": "幽光星星", "tags": [ "幽光星星" ] @@ -284,7 +284,7 @@ "hash": "d30275ba2734afbadf3aa38555146755b50fe352", "version": "d30275b", "author": "柠檬茶叶", - "description": "", + "description": "幽光星星", "tags": [ "幽光星星" ] @@ -295,7 +295,7 @@ "hash": "d7e30fa180404d7850f5c7b7badfc5d4a81ff5bc", "version": "d7e30fa", "author": "柠檬茶叶", - "description": "", + "description": "幽光星星", "tags": [ "幽光星星" ] @@ -306,7 +306,7 @@ "hash": "16c22741f88ab173f37623182029a03895c36476", "version": "16c2274", "author": "柠檬茶叶", - "description": "", + "description": "幽光星星", "tags": [ "幽光星星" ] @@ -317,7 +317,7 @@ "hash": "7fc8c1999ac223f9387cf44026591bfc34c7b951", "version": "7fc8c19", "author": "柠檬茶叶", - "description": "", + "description": "幽光星星", "tags": [ "幽光星星" ] @@ -2536,10 +2536,10 @@ { "name": "2.宵宫队[请看文件内说明].txt", "type": "file", - "hash": "3ceb9838769c84a415f2897db80ad1b7d21ece1e", - "version": "3ceb983", + "hash": "33aa7c52e63e8bc45195d60af20f9aef721b20a5", + "version": "33aa7c5", "author": "爱司基模人", - "description": "推荐配队\\n钟离 (夜/行/班/云/万)四选二 宵宫\\n不推荐云堇万叶一起上\\n钟离 芙宁娜 琴/早柚/班尼特 宵宫\\n风奶带风套最好(金珀小鹿?金珀砂糖?金珀散兵?),其他奶凑合用/n", + "description": "推荐配队\n钟离 (夜/行/班/云/万)四选二 宵宫\n不推荐云堇万叶一起上\n钟离 芙宁娜 琴/早柚/班尼特 宵宫\n风奶带风套最好(金珀小鹿?金珀砂糖?金珀散兵?),其他奶凑合用", "tags": [ "钟离", "芙宁娜", @@ -2712,7 +2712,7 @@ "hash": "2edd6804f44f208c9b19390d13e22d0a2b238576", "version": "2edd680", "author": "佚名", - "description": "推荐配队:\\n1钟离 夜班行云四选二 散兵\\n2钟离 珐露珊 四琴 散兵 琴不识别,四琴用不了 可以试试加个q收尾\\n3钟离 芙宁娜 四琴 散兵 琴不识别,四琴用不了\\n4莱依拉北斗 行秋 云珐夜班 散兵", + "description": "推荐配队:\n1钟离 夜班行云四选二 散兵\n2钟离 珐露珊 四琴 散兵 琴不识别,四琴用不了 可以试试加个q收尾\n3钟离 芙宁娜 四琴 散兵 琴不识别,四琴用不了\n4莱依拉北斗 行秋 云珐夜班 散兵", "tags": [ "钟离", "行秋", diff --git a/repo/combat/2.宵宫队[请看文件内说明].txt b/repo/combat/2.宵宫队[请看文件内说明].txt index 469fa77d..cc7953d1 100644 --- a/repo/combat/2.宵宫队[请看文件内说明].txt +++ b/repo/combat/2.宵宫队[请看文件内说明].txt @@ -1,5 +1,5 @@ // 作者:爱司基模人 -// 描述:推荐配队\n钟离 (夜/行/班/云/万)四选二 宵宫\n不推荐云堇万叶一起上\n钟离 芙宁娜 琴/早柚/班尼特 宵宫\n风奶带风套最好(金珀小鹿?金珀砂糖?金珀散兵?),其他奶凑合用/n +// 描述:推荐配队\n钟离 (夜/行/班/云/万)四选二 宵宫\n不推荐云堇万叶一起上\n钟离 芙宁娜 琴/早柚/班尼特 宵宫\n风奶带风套最好(金珀小鹿?金珀砂糖?金珀散兵?),其他奶凑合用 钟离 s(0.1),e(hold),wait(0.3),w(0.1)