fix quote wrapper

This commit is contained in:
Theo Browne
2026-02-20 05:34:04 -08:00
parent 0f653c79bb
commit 73e2d6382e

View File

@@ -160,7 +160,12 @@ export function isRealString(s: string, minLength = 5): boolean {
} }
export function cleanResponse(text: string): string { 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 ──────────────────────────────────────────────────────────── // ── AI functions ────────────────────────────────────────────────────────────