Skip to content

Commit

Permalink
🐛 Bug(chat): fix newlines in chat messages
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKenth committed May 24, 2024
1 parent 46e8e36 commit ec1d8c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fai-rag-app/fai-frontend/src/lib/components/SSEChat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
createSSE(currentMessageInput);
}
}
function formatMessageForMarkdown(content: string): string {
return content
.replace(/\n/g, `\n\n `);
}
</script>

<Div class="flex gap-5 p-5 flex-col items-center justify-center h-full overflow-hidden grow">
Expand All @@ -141,7 +146,7 @@
{#each messages as message (message.id)}
<ChatBubble
user={message.user}
content={message.content}
content={formatMessageForMarkdown(message.content)}
time={message.time}
isSelf={message.isSelf}
/>
Expand Down

0 comments on commit ec1d8c9

Please sign in to comment.