fix: 修复 esbuild 正则/模板字面量解析问题(反引号兼容性)

This commit is contained in:
Metona Build
2026-04-19 17:52:57 +08:00
parent f817abd5e1
commit a8fe322b67
3 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -607,7 +607,7 @@ ${conversationText.slice(0, 4000)}
});
const content = (response as { message?: { content?: string } })?.message?.content || '';
const jsonMatch = content.match(/```json\s*([\s\S]*?)\s*```/) || content.match(/\{[\s\S]*"entries"[\s\S]*\}/);
const jsonMatch = content.match(new RegExp('```json\\s*([\\s\\S]*?)\\s*```')) || content.match(/\{[\s\S]*"entries"[\s\S]*\}/);
if (!jsonMatch) return 0;