Skip to content

Commit

Permalink
Preserve formatting in user chat messages (#339) (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl authored Jul 12, 2024
2 parents ce345fb + b378ec7 commit b0d5b29
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/src/client/components/ConversationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,19 @@ export default function ConversationsList({
)}
</div>
)}
{(idx !== lastConversationIdx ||
(idx === lastConversationIdx && isUserConversation)) && (
{idx !== lastConversationIdx && !isUserConversation && (
<div className='chat-conversations text-base flex flex-col gap-2'>
<Markdown>{conversation.message}</Markdown>
</div>
)}
{isUserConversation && (
<div className='chat-conversations text-base flex flex-col gap-2'>
<Markdown>{`<p class="whitespace-pre-wrap break-words">${conversation.message.replaceAll(
'\n',
'<br />'
)}</p>`}</Markdown>
</div>
)}
{conversation.agentConversationHistory && (
<AgentConversationHistory
agentConversationHistory={
Expand Down

0 comments on commit b0d5b29

Please sign in to comment.