Skip to content

Commit

Permalink
Preserve formatting in user messages
Browse files Browse the repository at this point in the history
  • Loading branch information
harishmohanraj committed Jul 10, 2024
1 parent 8ea1e29 commit 269fd2b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/src/client/components/ConversationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,24 @@ export default function ConversationsList({
</div>
)}

{(idx !== lastConversationIdx || (idx === lastConversationIdx && isUserConversation)) && (
{idx !== lastConversationIdx && !isUserConversation && (
<div className='chat-conversations text-base flex flex-col gap-2 ml-4'>
<Markdown>{conversation.message === '' ? 'Auto reply' : conversation.message}</Markdown>
</div>
)}

{isUserConversation && (
<div className='chat-conversations text-base flex flex-col gap-2 ml-4 user-message-pre-block'>
<Markdown>
{conversation.message === ''
? 'Auto reply'
: `<p class="whitespace-pre-wrap break-words">${conversation.message.replaceAll(
'\n',
'<br />'
)}</p>`}
</Markdown>
</div>
)}
</div>
</div>
)}
Expand Down

0 comments on commit 269fd2b

Please sign in to comment.