From 73e2d6382ed4c87dc331004080557b2340119bb4 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Fri, 20 Feb 2026 05:34:04 -0800 Subject: [PATCH] fix quote wrapper --- game.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/game.ts b/game.ts index 760249c..5931a2e 100644 --- a/game.ts +++ b/game.ts @@ -160,7 +160,12 @@ export function isRealString(s: string, minLength = 5): boolean { } export function cleanResponse(text: string): string { - return text.trim().replace(/^["']|["']$/g, ""); + const trimmed = text.trim(); + if ((trimmed.startsWith('"') && trimmed.endsWith('"')) || + (trimmed.startsWith("'") && trimmed.endsWith("'"))) { + return trimmed.slice(1, -1); + } + return trimmed; } // ── AI functions ────────────────────────────────────────────────────────────