Code review cleanup for thinking display (#18720)

This commit is contained in:
Jacob Richman
2026-02-10 11:12:40 -08:00
committed by GitHub
parent 9813531f81
commit f9fc9335f5
16 changed files with 125 additions and 346 deletions
+7
View File
@@ -143,6 +143,13 @@ export function sanitizeForDisplay(str: string, maxLength?: number): string {
return sanitized;
}
/**
* Normalizes escaped newline characters (e.g., "\\n") into actual newline characters.
*/
export function normalizeEscapedNewlines(value: string): string {
return value.replace(/\\r\\n/g, '\n').replace(/\\n/g, '\n');
}
const stringWidthCache = new LRUCache<string, number>(
LRU_BUFFER_PERF_CACHE_LIMIT,
);