diff --git a/server/index.js b/server/index.js index f541b00..da6c8cc 100644 --- a/server/index.js +++ b/server/index.js @@ -879,6 +879,15 @@ function normalizeForQuickReply(value) { .trim(); } +function normalizeText(value) { + return String(value || "") + .replace(/\r\n?/g, "\n") + .replace(/\u00a0/g, " ") + .replace(/[ \t]+/g, " ") + .replace(/\n{3,}/g, "\n\n") + .trim(); +} + async function detectManualHandoff({ requestId, config,