From 9ff580b8ca7c6476f041c107b77c3d188cdae757 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 23 Nov 2024 22:58:09 -0800 Subject: [PATCH] fix: textarea input new line issue --- src/lib/components/chat/Chat.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 2cd766367..61a8a54cf 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2309,7 +2309,11 @@ on:submit={async (e) => { if (e.detail) { await tick(); - submitPrompt(e.detail.replaceAll('\n\n', '\n')); + submitPrompt( + ($settings?.richTextInput ?? true) + ? e.detail.replaceAll('\n\n', '\n') + : e.detail + ); } }} /> @@ -2346,7 +2350,11 @@ on:submit={async (e) => { if (e.detail) { await tick(); - submitPrompt(e.detail.replaceAll('\n\n', '\n')); + submitPrompt( + ($settings?.richTextInput ?? true) + ? e.detail.replaceAll('\n\n', '\n') + : e.detail + ); } }} />